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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bound vs Unbound

Status
Not open for further replies.
Sep 22, 1999
76
US
I'm new to VBA & Access and when i try to open a form that browses records to display records that belong to one employee id. I used strSql = &quot;select * from tblMain Where id =&quot; & intNum<br>
set db = currentDB()<br>
set rec = db.openRecordSet(strSQL,dbOPenDynaset)<br>
<br>
if i do a rec.recordcount i get the appropriate # of records<br>
but how do i get these to reflect in a Bound or unbound textbox<br>
Thanks<br>
<br>

 
Access provides a number of methods for working with databases. The simplest method is to assign a data source to your form. Then, controls can be bound to the data source's data items. With this method, writing code to set data objects and open recordsets is unnecessary.<br>
<br>
In form design view, open the form's properties window.<br>
<br>
Set the RecordSource property to point to a table or query.<br>
<br>
For each of your bound controls, set the CopntrolSource property to your data field.<br>
<br>
That should do it!<br>
<br>

 
Does this approach work when you have a series of unbound combo boxes, each used to drill down to a manageable set of records in the last combo box, and want to get the one record corresponding to that last combo box?

example:
combo1(unbound) (country)
-> combo2(unbound) (state)
- -> combo3(unbound) (city)

How do I get the specific 'city' record (&quot;Los Angeles&quot;) using these 3 unbound controls?

-seadog2001
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top