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!

Best Method For Displaying Data in Form

Status
Not open for further replies.

Fattire

Technical User
Nov 30, 2006
127
US
I'd like to use a SQL query to pull data straight from an Oracle DB into a form without having to insert the SQL data into an access table first, and then display the data from that table in the form, is this possible?

If so, maybe a brief overview or example of how that's done?
 
how are ya Fattire . . .

Have a look at the [blue]RecordSource[/blue] property of a form! . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Can I use an ADODB recordset as the record source since I'm not using a query nor a pass-through query in the access db itself?

If so, how would that look in the properties window, just the name of the recordset along with the forms parameter field as the Filter?
 
Code:
Private Sub cmdFindInformation_Click()
Dim rec As New ADODB.Recordset
Dim con As New ADODB.Connection
Dim sql As String

con.Open "Provider=MSDAORA......

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 & "'"
'Debug.Print sql
rec.Open sql, con, adOpenDynamic, adLockOptimistic

End Sub

So this is what I have so far....how do I call a specific record from the record set (rec) to a text field in the form?



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top