Trouble linking forms

G

Guest

I'm trying to go from a continuous form [quick time change form] where
patients are listed on a single line to a single form [Main] where you can
enter additional information, like demographics, etc. on that patient if you
need to. I'm trying to do it when they double click the Medical record
number [MR#] on the continuous form. I've taken advise from another message
in the discussion group, but am stuck. When I double click the MR#, it takes
me to the Main form, but it takes me to the first record. Not sure what I'm
doing wrong. I created the following line of code in the double click event
for MR# based on what was advised in the other discussion group message:
DoCmd.OpenForm "Main", , , [MR#] = Forms![quick time change form]![MR#]
 
M

Marshall Barton

Keeler said:
I'm trying to go from a continuous form [quick time change form] where
patients are listed on a single line to a single form [Main] where you can
enter additional information, like demographics, etc. on that patient if you
need to. I'm trying to do it when they double click the Medical record
number [MR#] on the continuous form. I've taken advise from another message
in the discussion group, but am stuck. When I double click the MR#, it takes
me to the Main form, but it takes me to the first record. Not sure what I'm
doing wrong. I created the following line of code in the double click event
for MR# based on what was advised in the other discussion group message:
DoCmd.OpenForm "Main", , , [MR#] = Forms![quick time change form]![MR#]


That looks good except WhereCondition is a string argument
containing the expression:

If the MR# field is a numeric type (Integer, Long, etc),
then use:

DoCmd.OpenForm "Main", , , "[MR#] = " & Me![MR#]

If MR# is a text type, use:

DoCmd.OpenForm "Main", , , "[MR#] = """ & Me![MR#] & """"
 
G

Guest

Awesome, it worked like a charm. What a great site, this has helped me
tremendously this week!

Marshall Barton said:
Keeler said:
I'm trying to go from a continuous form [quick time change form] where
patients are listed on a single line to a single form [Main] where you can
enter additional information, like demographics, etc. on that patient if you
need to. I'm trying to do it when they double click the Medical record
number [MR#] on the continuous form. I've taken advise from another message
in the discussion group, but am stuck. When I double click the MR#, it takes
me to the Main form, but it takes me to the first record. Not sure what I'm
doing wrong. I created the following line of code in the double click event
for MR# based on what was advised in the other discussion group message:
DoCmd.OpenForm "Main", , , [MR#] = Forms![quick time change form]![MR#]


That looks good except WhereCondition is a string argument
containing the expression:

If the MR# field is a numeric type (Integer, Long, etc),
then use:

DoCmd.OpenForm "Main", , , "[MR#] = " & Me![MR#]

If MR# is a text type, use:

DoCmd.OpenForm "Main", , , "[MR#] = """ & Me![MR#] & """"
 

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