Question on Unbound Forms with VB

B

Ben

Hi everyone,

I have two unbound forms. One of them is call Computer and
the other is compuser. In the computer form I have a
textbox call compid. I created a command button call open.
When I click on open, this command button takes the value
in compid and open up the compuser form and placed the
value from the compid into one of the textbox in the
compuser form. Is this possible to be done?

Any help is appriciated.

Ben
 
M

Marshall Barton

Ben said:
I have two unbound forms. One of them is call Computer and
the other is compuser. In the computer form I have a
textbox call compid. I created a command button call open.
When I click on open, this command button takes the value
in compid and open up the compuser form and placed the
value from the compid into one of the textbox in the
compuser form. Is this possible to be done?


I prefer to use the OpenForm method's OpenArgs for this kind
of thing. In the Computer form's command button's Click
event, open the CompUser form like this:

DoCmd.OpenForm "CompUser", scNormal, _
OpenArgs:= CompID

Then in the CompUser form's Load event:

If Not IsNull(Me.OpenArgs) Then
Me.sometextbox = Me.OpenArgs
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top