how to limit a form to only one record from a table other than form's source table

shwan

Registered User.
Local time
Yesterday, 22:42
Joined
Nov 18, 2017
Messages
13
Hello,
So I have this simple database that contains only two tables. one contains customers information the other contains their payments.
I made a main form that pulls information from a query based on these two tables. When the user clicks on a record in this main form another form opens that shows the payments of this specific record, I did that using simple code in the where clause in on click event of the name field. My problem now is that when the user wants to add new payment on this second form they can enter a payment to any other customer not only the one that they clicked in the main form. How can I limit the second form to only the record that the user clicked in the main form. I attached my database.
Thank you very much
 

Attachments

I've not looked at your db.
All you need to do is open the second form filtered to the required record i.e. customer.
 
I've not looked at your db.
All you need to do is open the second form filtered to the required record i.e. customer.

Is not that what where clause supposed to do. I think when the form opens it is already filtered since it shows all the payment related to one record only, but still, you can enter a new payment unrelated to that record and I want to prevent that.
 
Is not that what where clause supposed to do. I think when the form opens it is already filtered since it shows all the payment related to one record only, but still, you can enter a new payment unrelated to that record and I want to prevent that.

Try locking any controls that you don't want the user to edit
 
Is not that what where clause supposed to do. I think when the form opens it is already filtered since it shows all the payment related to one record only, but still, you can enter a new payment unrelated to that record and I want to prevent that.
Yes it is correct, it is filtered but it is not locked to a certain record (Id).
You need a constellation know as Main-/Sub-form.
 

Users who are viewing this thread

Back
Top Bottom