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

How to Change Default Form Function

Status
Not open for further replies.

DD999

IS-IT--Management
May 8, 2003
29
CA
This is weird. I've created a form thatI want to use to add new data or edit existing records.

Using a combo box I want to select customerID and then have cust_name and cust_address show up. All info is in the same table.

Access will let me choose a value in the combo box but it doesn't update the other two fields with the corresponding info.

I've tried it using a query and I've tried it working directly from the table and neither works.

What am I missing??
 
Hi

The combo you are using to do the selecting should be unbound

You need code in the after update event of the combo to read the selected record, do you have that?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi

The code in the after update event will look something like so

Private Sub cboDeliveryAddrId_AfterUpdate()
Dim Rs As Recordset
'
Set Rs = Me.RecordsetClone
Rs.FindFirst "lngDeliveryAddr = " & cboDeliveryAddrId
If Rs.NoMatch Then
Else
Me.Bookmark = Rs.Bookmark
End If
Set Rs = Nothing
End Sub

using your own control names etc

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top