Open different forms from one ID number

dorien90

New member
Local time
Tomorrow, 00:35
Joined
Mar 1, 2013
Messages
5
Hi everyone,

I'm new with Access 2007 and VBA. I'm creating a database and I have following problem.

In this database I have created an addressbook. In this addressbook are mentionned all the details of the customers and the prospect ( with a different ID). When you click on the ID number the correct detail file should open.

So for the customers it would mean, that it should open frmCustomerDetails and for my opportunities it would mean open frmOpportunitieDetails. But there is only one ID number mentionned.

Is there any possibility to create a VBA code to open different forms from one ID number?

Can someone please help me and give me some advise?

Thank you very much!
 
If the ID number is a textbox, then it might not work well to make it happen by clicking in the box, but if that's what you want, this should do it:

Code:
Private Sub ID_Click
    DoCmd.OpenForm (frmCustomerDetails)
    DoCmd.FindRecord Me.ID.Value
    DoCmd.OpenForm (frmOpportunitieDetails)
    DoCmd.FindRecord Me.ID.Value
End Sub

Another way would be to put the two forms as subforms on the addressbook form.
 

Users who are viewing this thread

Back
Top Bottom