E
ecwhite
I am using MS ACCESS 2003
I have a main form and a subform that pulls up an existing case for the user
to update the information already entered. The subform is designed and opens
up in form view not in datasheet view.
The subform knows which case to pull in based on the case number on the main
form
The textboxes on the main form are bound fields from a query. The user
enters an ID which is how the main form query knows which record to pull and
it works.
The textboxes on the subform are bound with data from a different query (so
I have a query for each form)
The query tied to the record source of the subform prompts for a case number
which is already in the main form.
PROBLEM
I will like to pass the case number from the main form to the QUERY that
populates the subform without seeing the prompt come up.
So how can I pass the case number from the main form after it opens so that
when both the main and subform are open all the data is populated without the
user entering a matching case number for the subform query to pull the
corresponding data from a different table.
This is what I have done for the where criteria in the subform query
SELECT t_mytable.case_nbr, t_mytable.code, t_mytable.added_by
FROM t_mytable
WHERE (((t_mytable.case_nbr)=[Forms]![sub_frm_update]![case_nbr]));
Please note that I have also tried it with [frm_MAINFORM_lookup]![case_nbr]
I get prompted for the case number by the subquery criteria and I don’t want
it.
Thanks.
I have a main form and a subform that pulls up an existing case for the user
to update the information already entered. The subform is designed and opens
up in form view not in datasheet view.
The subform knows which case to pull in based on the case number on the main
form
The textboxes on the main form are bound fields from a query. The user
enters an ID which is how the main form query knows which record to pull and
it works.
The textboxes on the subform are bound with data from a different query (so
I have a query for each form)
The query tied to the record source of the subform prompts for a case number
which is already in the main form.
PROBLEM
I will like to pass the case number from the main form to the QUERY that
populates the subform without seeing the prompt come up.
So how can I pass the case number from the main form after it opens so that
when both the main and subform are open all the data is populated without the
user entering a matching case number for the subform query to pull the
corresponding data from a different table.
This is what I have done for the where criteria in the subform query
SELECT t_mytable.case_nbr, t_mytable.code, t_mytable.added_by
FROM t_mytable
WHERE (((t_mytable.case_nbr)=[Forms]![sub_frm_update]![case_nbr]));
Please note that I have also tried it with [frm_MAINFORM_lookup]![case_nbr]
I get prompted for the case number by the subquery criteria and I don’t want
it.
Thanks.