Double click to open form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greets.

I have a Form listing all my orders (number type) as the primary key for an
orders table. I want to double click one of the orders shown (double click
the text box) and open other form that contains all details FROM THAT ORDER
alone.

Thanks for the help.
 
Jose,

There is a DoubleClick event for textboxes (and many
controls). Put your code to open the form there by clicking
on the event builder button and choosing Code. You will have
to modify this for your control and form names...

docmd.OpenForm "YourFormName",,,"[OrderID] = " & Me!OrderID

--
Gary Miller
Sisters, OR



message
news:[email protected]...
 
Your code works like a charm with my orders field.

I don't understand anything of VB (except what I try to learn from the VB
help) but I also tried it with my products table but it doesn't work. I think
it is because my products reference field (and primary key) "Reference" is of
string type and manually inputed. I tried to change your code in the
,,,'where' statement of the open form command but it only brings up an empty
form and several code errors :) Can you help me setting it for this string
type filter (by the way "Me!" refers to a filter, am I right?)

Thank you very much Gary.

Gary Miller said:
Jose,

There is a DoubleClick event for textboxes (and many
controls). Put your code to open the form there by clicking
on the event builder button and choosing Code. You will have
to modify this for your control and form names...

docmd.OpenForm "YourFormName",,,"[OrderID] = " & Me!OrderID

--
Gary Miller
Sisters, OR



message
Greets.

I have a Form listing all my orders (number type) as the
primary key for an
orders table. I want to double click one of the orders
shown (double click
the text box) and open other form that contains all
details FROM THAT ORDER
alone.

Thanks for the help.
 
Jose,

Glad that it did the trick for you. If you need to modify
this for a string instead of a number, you need to wrap the
value in single quotes using some concantenation...

docmd.OpenForm "YourFormName",,,"[Reference] = '" &
Me!Reference & "'"

The 'Me' keyword refers to the active form you are calling
code from and saves you having to make an explicit reference
to the form by name. Saves a lot of typing.

--
Gary Miller
Sisters, OR



message
Your code works like a charm with my orders field.

I don't understand anything of VB (except what I try to
learn from the VB
help) but I also tried it with my products table but it
doesn't work. I think
it is because my products reference field (and primary
key) "Reference" is of
string type and manually inputed. I tried to change your
code in the
,,,'where' statement of the open form command but it only
brings up an empty
form and several code errors :) Can you help me setting
it for this string
type filter (by the way "Me!" refers to a filter, am I
right?)

Thank you very much Gary.

Gary Miller said:
Jose,

There is a DoubleClick event for textboxes (and many
controls). Put your code to open the form there by
clicking
on the event builder button and choosing Code. You will
have
to modify this for your control and form names...

docmd.OpenForm "YourFormName",,,"[OrderID] = " &
Me!OrderID

--
Gary Miller
Sisters, OR



in
message
Greets.

I have a Form listing all my orders (number type) as
the
primary key for an
orders table. I want to double click one of the orders
shown (double click
the text box) and open other form that contains all
details FROM THAT ORDER
alone.

Thanks for the help.
 
Friend,

joel-ange sitbon has invited you to join GreenZap and get $50 WebCash to
spend online. Sign up for a FREE GreenZap account and get $50 to spend at
hundreds of the world's premier merchants, many of whom are offering
incredible upfront discounts. Click on the link below to go to GreenZap and
signup! All thanks to joel-ange sitbon.

It's Zappening in the GreenZap Storez.
http://www.greenzap.com/joel1962

If you do not want to receive these emails in the future click the link
below:
http://www.greenzap.com/optout_invite.asp


Gary Miller said:
Jose,

Glad that it did the trick for you. If you need to modify this for a
string instead of a number, you need to wrap the value in single quotes
using some concantenation...

docmd.OpenForm "YourFormName",,,"[Reference] = '" & Me!Reference & "'"

The 'Me' keyword refers to the active form you are calling code from and
saves you having to make an explicit reference to the form by name. Saves
a lot of typing.

--
Gary Miller
Sisters, OR



Jose Lopes said:
Your code works like a charm with my orders field.

I don't understand anything of VB (except what I try to learn from the VB
help) but I also tried it with my products table but it doesn't work. I
think
it is because my products reference field (and primary key) "Reference"
is of
string type and manually inputed. I tried to change your code in the
,,,'where' statement of the open form command but it only brings up an
empty
form and several code errors :) Can you help me setting it for this
string
type filter (by the way "Me!" refers to a filter, am I right?)

Thank you very much Gary.

Gary Miller said:
Jose,

There is a DoubleClick event for textboxes (and many
controls). Put your code to open the form there by clicking
on the event builder button and choosing Code. You will have
to modify this for your control and form names...

docmd.OpenForm "YourFormName",,,"[OrderID] = " & Me!OrderID

--
Gary Miller
Sisters, OR



message
Greets.

I have a Form listing all my orders (number type) as the
primary key for an
orders table. I want to double click one of the orders
shown (double click
the text box) and open other form that contains all
details FROM THAT ORDER
alone.

Thanks for the help.
 
Back
Top