changing tabs by doubleclick on list box

Joined
Jan 4, 2006
Messages
1
Reaction score
0
Hi,

I've got form "FrmMain" with 2 tabs, "Tab1" and "Tab2"
Tab1 contains customer-data "frmCust" and Tab2 "frmSrch" ist used for searches.
The form on Tab2 contains a field for searches which displays in a all matching entries in a list box (with several columns - ID, First Name, Surname). So far this works fine.

What i want is to jump to the appropiate entry of my customer on Tab1 by doubleclicking an entry in the list box on Tab2.

The code is:
Code:
Private Sub ResultCustSrch_DblClick(Cancel As Integer)
  
  	DoCmd.GoToControl Forms![FrmMain]![frmCust]![ID]
  	DoCmd.Requery "ID"
  	DoCmd.FindRecord ID, acEntire, False, , False, acCurrent, True
  
 End Sub
The message i get is "The current record contains no field named 0001" (or similar, as it's not an english access), 0001 is the first record of the table Customers. ID is formated as text in the customer table.

It's very likely that it's just a simple setting as i'm a beginner for VBA, but neither the online help gives me the right clue nor "The access bible". So any help is very appreciated. Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top