LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default ADO assist

I'm trying to create a sales ticket (on a vb form) and fetching results from
an Access database. When I try to get the results from the recordset, it
doesn't look right. I've re-imported the data with "trim(<fieldname)" to
make sure that I'm not picking up extra characters. First, here's the data
and how it should look
<the ticket_desc below looks fine
121
CREEK TWP.
RR4 BOX 334
CLINTON, IL 61727

Here's the code:

Dim cAcc As New ADODB.Connection
Dim rsAcc As New ADODB.Recordset

Private Sub pbPrint_Click()
Dim Line1, Line2, Line3 As String
Dim v1, v2, v3 As String

Set rsAcc = cAcc.Execute(" Select ticket_desc from co_locn")
'This is fine.. it looks good
tbCoLocnAddr.Text = rsAcc(0)
Set rsAcc = cAcc.Execute(" Select a.ticket_nbr, b.name, b.address, b.city,
b.state, b.zip, b.cust_id from Sale a, Customer b where a.ticket_nbr=121 and
" & _
"a.cust_id=b.cust_id and a.address_seq_num = b.address_seq_num")
tbTicket.Text = rsAcc(0)
Line1 = rsAcc.Fields(1)

It didn't matter whether I had rsAcc(1) or rsAcc.Fields(1), line 1 (in
debug) ended up:
CREEK TWP. F RR4 BOX 334
It's the name AND the address..can you not reuse the same recordset or do
you have to 'reset' it before using it again?





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assist with formula Soth Excel Worksheet Functions 3 June 30th 09 05:41 AM
Please assist... soke2001 Excel Worksheet Functions 3 September 15th 07 01:59 PM
Can't remember....please assist Latina Excel Discussion (Misc queries) 4 February 8th 07 08:20 PM
Formula Assist [email protected] Excel Discussion (Misc queries) 3 June 7th 06 12:37 AM
Please assist Bubba_James Excel Worksheet Functions 1 September 9th 05 06:28 PM


All times are GMT +1. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"