Macro condition to open sub form (1 Viewer)

DeepTrouble

Registered User.
Local time
Today, 14:09
Joined
Apr 24, 2001
Messages
18
I have added a Macro which will open a sub form, address 2 when ZIP code = 400062. However the Macro opens on all ZIP codes. Macro has following properties:
Form Name: address 2
View: Form
Filter name:
Where Condition: [ZIP code]= "400062"
Data Mode: Add
Window Mode: Normal
I will appreciate any help
DeepTrouble
 

shuff

Registered User.
Local time
Today, 14:09
Joined
Oct 13, 2000
Messages
61
If what you want to do is open a form for additional input fields upon the condition that ZIP="40062," I would approach that by setting the AfterUpdate property on the field in the first form to be tested. Set that field's AfterUpdate property to run a macro that tests the value just entered. If the test returns FALSE (zip test fails) then pass the focus on to the next control in that form. If the test returns TRUE (target zip is entered), then OpenForm (formname) in Add Mode, with the target zip code already filled in on the subform (and that control locked because it is your key and you don't want the user to edit it). Remember to add a button on the subform so that when the user is done inputting, clicking on it closes the subform and returns control to the primary form, saving the subform's record.
 

DeepTrouble

Registered User.
Local time
Today, 14:09
Joined
Apr 24, 2001
Messages
18
Thank you very much.
I will post the progress.
 

DeepTrouble

Registered User.
Local time
Today, 14:09
Joined
Apr 24, 2001
Messages
18
I tried as you have suggested, however the forms open for any ZIP code.Any suggestion?
Thanks for your time and suggestion.
 

Users who are viewing this thread

Top Bottom