SteveL13
asked on
Make command button visible if record exists in a 2nd table
I have a command button on a form which has a query as its record source. The query comes from a table that has a number field as its key field. The name of the field in the table is "JobN" and there is a field on the form named "txtJobN" which has the key table field as its control source.
The command button by default is not visible. But I want it to become visible if there is a like entry in a second table. This second table has a key field identical to the key field in the 1st table. What would the code be for the onopen (or would it be oncurrent?) event of the form?
Then, when the command button becomes visible and is clicked, I want a form to open to display the record in the second table.
What is my onclick event for the command button?
--Steve
The command button by default is not visible. But I want it to become visible if there is a like entry in a second table. This second table has a key field identical to the key field in the 1st table. What would the code be for the onopen (or would it be oncurrent?) event of the form?
Then, when the command button becomes visible and is clicked, I want a form to open to display the record in the second table.
What is my onclick event for the command button?
--Steve
ASKER
Good so far...
And then,
When the command button becomes visible and is clicked, I want a form to open to display the record in the second table.
What is my onclick event for the command button?
And then,
When the command button becomes visible and is clicked, I want a form to open to display the record in the second table.
What is my onclick event for the command button?
You can add a where condition to the form, such as:
DoCmd.OpenForm("frmsecondO ne",,,"Job N=" & me.txtJobN)
DoCmd.OpenForm("frmsecondO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
me.command0.visible=dcount