G
Guest
Hi. I have a Switchboard with two buttons that should open the same form
(frmEditProjectStatus) as follows:
Button 1- Used to add a new record. No problems with this one.
Button 2- Used to make a combo box visible. When a user selects his/her name
from the combo box a list of that user's projects is shown. When the user
double-clicks a project, the form opens and goes to that specific record.
I currently have 2 identicle forms with two queries to handle this (one for
each button). I know there is a way to do this using a single form and a
single query but I do not know the code. I currently have the following in
place for the "filtered" form:
In the query (qryProjectFiltered) I have the following in the criteria of
the Project ID field:
[forms]![SwitchBoard1]![ListProjects]
In the list box (ListProjects) on the Switchboard I have the following event
procedure in the "On Dbl Click" event.
DoCmd.OpenForm "frmEditProjStatusFiltered"
Is there a string that can be used such that "If button 1, goto new record,
else [forms]![SwitchBoard1]![ListProjects]? And if so, would the code remain
in the criteria for the Project ID field?
Thank you very much in advance for your assistance.
(frmEditProjectStatus) as follows:
Button 1- Used to add a new record. No problems with this one.
Button 2- Used to make a combo box visible. When a user selects his/her name
from the combo box a list of that user's projects is shown. When the user
double-clicks a project, the form opens and goes to that specific record.
I currently have 2 identicle forms with two queries to handle this (one for
each button). I know there is a way to do this using a single form and a
single query but I do not know the code. I currently have the following in
place for the "filtered" form:
In the query (qryProjectFiltered) I have the following in the criteria of
the Project ID field:
[forms]![SwitchBoard1]![ListProjects]
In the list box (ListProjects) on the Switchboard I have the following event
procedure in the "On Dbl Click" event.
DoCmd.OpenForm "frmEditProjStatusFiltered"
Is there a string that can be used such that "If button 1, goto new record,
else [forms]![SwitchBoard1]![ListProjects]? And if so, would the code remain
in the criteria for the Project ID field?
Thank you very much in advance for your assistance.