Simple issue regarding opening a form to a specific record, how to fix? (1 Viewer)

kvnd

Registered User.
Local time
Today, 10:02
Joined
Oct 9, 2018
Messages
16
I have a continuous form here which lists records. You are unable to edit the records on the continuous form which is what I want. To edit records, the user should click the "Edit Record" button next to the record the user wishes to edit. This takes you to a form called "Data Editor" where you can edit that specific record. The "Edit Record" button is designed to take you to a form which should display the record where the ID equals the ID box on the continuous form. However, this button is not working as intended. It is almost working. It works fine when the Data Editor form is open in the background, however when it is not open in the background the "Edit Record" button will open the form but the form will be blank. I do not want this. I want the button to work as intended even if the Data Editor form is not currently open.

Attached is a picture showing what's going on
 

Attachments

  • Complaints.jpg
    Complaints.jpg
    99.5 KB · Views: 55

theDBguy

I’m here to help
Staff member
Local time
Today, 07:02
Joined
Oct 29, 2018
Messages
21,358
Hi. Can you post the code behind the button? Thanks.
 

kvnd

Registered User.
Local time
Today, 10:02
Joined
Oct 9, 2018
Messages
16
Hi. Can you post the code behind the button? Thanks.

I didn't make it with VBA, I made it using the the command button wizard. This is the line of options I selected:

Form Operations > Open Form > Data Editor > Open the form and find specific data to display > where ID = ID
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:02
Joined
Oct 29, 2018
Messages
21,358
Try enclosing the last "ID" in square brackets. Just guessing (without actually seeing it).
Code:
where ID=[ID]
 

kvnd

Registered User.
Local time
Today, 10:02
Joined
Oct 9, 2018
Messages
16
Try enclosing the last "ID" in square brackets. Just guessing (without actually seeing it).
Code:
where ID=[ID]

I just opened the embed macro to look at the code. This is the where condition:

="[ID]=" & [ListID]

ListID is the name of the ID text box in the continuous form. Again, this button works properly - but only when the form this button opens is already open in the background. So I'm not sure that part is relevant?

I thought it just needs to update to meet this condition on loading up the form or something? You don't think so?
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 07:02
Joined
Oct 29, 2018
Messages
21,358
Hi. I think the WhereCondition part, as you’re describing it to us, is probably fine. Why the form is not opening to the selected ID may have to do with the other arguments you have in the embedded macro. Can you show us the whole thing just to be sure? Thanks.
 

kvnd

Registered User.
Local time
Today, 10:02
Joined
Oct 9, 2018
Messages
16
Hi. I think the WhereCondition part, as you’re describing it to us, is probably fine. Why the form is not opening to the selected ID may have to do with the other arguments you have in the embedded macro. Can you show us the whole thing just to be sure? Thanks.

Sorry, but I just found the issue myself! The form for editing the data had the data entry property sent to yes. I changed it to no, and it works now. Issue is resolved. Thanks anyway
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:02
Joined
Oct 29, 2018
Messages
21,358
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom