Two buttons - one form - two different purposes for the form!

mackyrm

Registered User.
Local time
Yesterday, 16:11
Joined
Oct 5, 2006
Messages
57
Access 2003


I would like to use the same form for two different tasks (say... form B).

1) I would like to use a button on a form (form A) to access a second related form (B). I would like to know if there is any VBA that will ensure that the second form only opens the sub record of interest with already populated data

2) I would like to use a different button on form A, to access a second related form (form B again) - only to add a NEW record on this form

Is there any VBA that will allow me to use the same form:

1) to open an existing related record to view an existing sub-record only
2) add a new sub-record only

Any help appreciated!
 
1) Using a WhereCondition argument in the OpenForm command applies a filter to the form.
2) Using the acFormAdd DataMode argument in the OpenForm command set the form to Add REcords only.
This is all covered in VBA Help under the OpenForm command.
 
I'm an OLD RuralGuy and VBA is still over my head. :-(

I was hoping there was a simple way to do this without 2 forms. I could build a second form to the QUERY, I guess. Thanks anyhow.
 

Users who are viewing this thread

Back
Top Bottom