Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I push data from adodb recordset into txtbox?

Status
Not open for further replies.

Fattire

Technical User
Nov 30, 2006
127
US
A cmd button kicks off a query to an Oracle database all via adodb.connection, collects in rs called 'rec'.

Code:
con.Open "Provider=MSDAORA;" & "Data Source=...blah blah

chk_no = Me.txtCheckNumber

sql = ""
sql = sql & "select check_number"
sql = sql & "     , vendor_name"
sql = sql & "     , check_date"
sql = sql & "     , amount"
sql = sql & "     , creation_date"
sql = sql & "  from ap.ap_checks_all"
sql = sql & " where check_number = '" & chk_no & "'"

rec.Open sql, con, adOpenDynamic, adLockOptimistic

Query runs fine, no errors...

What do I type in the Record Source of the form to get to the rec? It's just wants an access table or query, which I'm not using. I assume the record source is only built for those.

I'm trying to call the values from the recordset immediately via the control source so that (for example) the rec!vendor_name shows up automatically in a text box called txtvendor_name on a form called frmCheckInfo?

I've tried rec!vendor_name, rec.vendor_name, [rec]![vendor_name] and nothing works, it just says #NAME?

I have a strong feeling I'm way close or WAY off on all this...appreciate your help in advance.

 
...
rec.Open sql, con, adOpenDynamic, adLockOptimistic
Forms!frmCheckInfo!txtvendor_name = rec!vendor_name
...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top