open form with item no (1 Viewer)

Geoffk

Registered User.
Local time
Today, 22:52
Joined
Feb 24, 2007
Messages
22
Hi All,

I have a form that I enter item no's into.

What I would like to achieve is to open another form when a particular item no is entered.

GeoffK
 

John Big Booty

AWF VIP
Local time
Today, 22:52
Joined
Aug 29, 2005
Messages
8,262
I'm not quite sure I understand what you want to do.

Could you possibly explain step by step what the user will do, and exactly what the trigger point for the second form opening is?
 
Last edited:

speakers_86

Registered User.
Local time
Today, 08:52
Joined
May 17, 2007
Messages
1,919
Code:
after update
if controlnamehere.value=x then
docmd.openform "yourformnamehere"
end if


That should get you in the right direction.
 

Geoffk

Registered User.
Local time
Today, 22:52
Joined
Feb 24, 2007
Messages
22
Thanks John Big Booty and Speakers 86 for your replies,

Speakers 86 I have tried code and it works ok, I have tried to modify it to open a subform that is visible=false basing my modification on:

if controlnamehere.value=x then

Me.controlnamehere.Visible = True
Else
Me.controlnamehere.Visible = False
End If

I get no error message but jumps to visual basic screen

Any suggestions

GeoffK
 

Geoffk

Registered User.
Local time
Today, 22:52
Joined
Feb 24, 2007
Messages
22
John Big Booty

Thanks for your reply, I have tried every combiation to your code but cannot get it to work.

If ItemID.Value = 61327 Then
Me!UsageSubForm.Form.Visible = True
End If

On the main form is 2 SubForms "ItemsSubForm" and "UsageSubForm"
The control "ItemID" is in a subform "ItemsSubForm" and I would like to make visible "UsageSubForm".

I have looked through the site you suggested, but no success.

Thanks again
GeoffK
 

speakers_86

Registered User.
Local time
Today, 08:52
Joined
May 17, 2007
Messages
1,919
It looks like you are referencing the subform, when you should be referencing the name of the control that holds the subform. To find the name of the control, go your form in design mode, click on the subform, then click on the very outermost square that surrounds the subform. That should be the control. If you are on the control, the properties window will have 2 options that say something like Parent Field Link and Child Field Link. Look at the top of the properties window, and their will be a field called Name. Whatever you have in that field should be in your code, instead of "UsageSubform".
 

Users who are viewing this thread

Top Bottom