Photo Id should equal to Member_ID

  • Thread starter Frank Situmorang
  • Start date
F

Frank Situmorang

Hello,

In my membership form, I have a member_id and in the Photo Tab, I put a
subform for photo, I have a photo_ID where in this form church secreatary can
key in image path.

To ensurethat the photo is realted to the member, I want to make on the
PHoto_id textbox a validation that the number here should be the same with
the nubmer of member_ID, if not there is a messagebox.

Can anyone tell me the VBA in the Photo_ID textbox?.

Thanks in advance
 
B

Bob Quintal

Hello,

In my membership form, I have a member_id and in the Photo Tab, I
put a subform for photo, I have a photo_ID where in this form
church secreatary can key in image path.

To ensurethat the photo is realted to the member, I want to make
on the PHoto_id textbox a validation that the number here should
be the same with the nubmer of member_ID, if not there is a
messagebox.

Can anyone tell me the VBA in the Photo_ID textbox?.

Thanks in advance
You do not need any VBA. Access will automatically do this for you.
When you create the subform control, specify the link parent fields
property to be the member_ID and link child fields property to be the
photo_id.

When you add a new record to the subform, the member_ID will be
automatically put in the Photo_id field of the subform.
 
F

Frank Situmorang

Bob, can you do it on the one to one relationship?, and we can only do one to
one, if the Photo Id is primary key.

I have done the same way before, but it seems that it is going to add a
member id and when I filled in the path image the error message says that a
certain field is requeired, while I did not intend to add the member records.

Do you know why the error messages says like that?

Thanks a lot
 
B

Bob Quintal

Bob, can you do it on the one to one relationship?, and we can
only do one to one, if the Photo Id is primary key.
Photo ID should be primary key of Photos table Member ID should be
primary key of Members table and foreign key of Photos table.

If you want to limit 1 photo per member, make the foreign key
unique.
I have done the same way before, but it seems that it is going to
add a member id and when I filled in the path image the error
message says that a certain field is requeired, while I did not
intend to add the member records.
Do you know why the error messages says like that?

I cannot see your database, the error message, your relationships,
etc...
Thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top