By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

Main Form Linking to PopUp?

P: 1
Hello,

Try to explain this as best as I can.
I have a main form with several cmd buttons, (Not interested in subforms for this project) that opens popup forms.

Example: Main form frmPerson, cmd button cmdVehicle, when clicked opens frmVehicle displaying control boxes to be populated by the user. My problem is that I can't figure out how to link this PopUp Form frmVehicle to the main form, frmPerson.

I tried openargs but when I attempt to create a new record, the form is refreshed and the openargs linking is not working.

Any help is greatly appreciated,

Thanks,
Dec 2 '06 #1
Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,669
Hello,

Try to explain this as best as I can.
I have a main form with several cmd buttons, (Not interested in subforms for this project) that opens popup forms.

Example: Main form frmPerson, cmd button cmdVehicle, when clicked opens frmVehicle displaying control boxes to be populated by the user. My problem is that I can't figure out how to link this PopUp Form frmVehicle to the main form, frmPerson.

I tried openargs but when I attempt to create a new record, the form is refreshed and the openargs linking is not working.

Any help is greatly appreciated,

Thanks,
'Assuming [ID] is the Linking Field between frmPerson and frmVehicle, and
'you are populating frmVehicle with Child Records to frmPerson:

In the Current() Event of frmVehicle place the following line of code:

Expand|Select|Wrap|Line Numbers
  1. Me![ID] = Forms!frmPerson![ID]
Dec 2 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Hello,

Try to explain this as best as I can.
I have a main form with several cmd buttons, (Not interested in subforms for this project) that opens popup forms.

Example: Main form frmPerson, cmd button cmdVehicle, when clicked opens frmVehicle displaying control boxes to be populated by the user. My problem is that I can't figure out how to link this PopUp Form frmVehicle to the main form, frmPerson.

I tried openargs but when I attempt to create a new record, the form is refreshed and the openargs linking is not working.

Any help is greatly appreciated,

Thanks,
You need to add criteria to the DoCmd.OpenForm statement

e.g.
Expand|Select|Wrap|Line Numbers
  1. Dim stLinkCriteria
  2.  
  3.    stLinkCriteria = "[ID]=" & Me.ID
  4.  
  5.    DoCmd.OpenForm "frmVehicle", , , stLinkCriteria
  6.  
Dec 3 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.