Ms access auto search while update first filed (1 Viewer)

Salih

New member
Local time
Today, 21:36
Joined
Jan 14, 2025
Messages
4
Hi,
I hope you all fine.
Please see the attached file .
database with three fields.
1-The initial inquiry pertains to the process of entering a new name. I would like the system to conduct a search to determine if that name has been previously saved. If it has, a message should be displayed indicating that the name has already been added, prompting the user to confirm whether they wish to update the information with a "Yes" or "No" option. Conversely, if the name has not been saved before, a message should appear asking if the user would like to add it, again providing "Yes" or "No" options.

2-When a new record is created, the individual's photo, along with their ID information, will be saved on the computer. The photo will be renamed according to the ID information. Upon updating the field designated as ID Information, we require the photo to be automatically included in the field labeled Photo, formatted to the dimensions of a passport.

see attached file as test

thanks in advance
 

Attachments

1. Use a DlookUp() or DCount() to determin if the name already exists.
2. Use Filedialog to select the relevant image. Move that to a location of your choosing, then put that path into the required /control of the form or field in the table
 
As an added useful action: Once you have stored the fully qualified file specification in the appropriate record, you can later call up that record on the form by loading that file spec as a string to the image control's .Picture property in the Form_Current routine for that form. Gasman's comment about moving the picture is good. Before you actually store the file spec string, move the picture to a shared area (for shared databases) or a convenient area (for non-shared databases). Then store the file spec string of the moved copy of the picture, not of the original copy.
 
This process is a little more complicated than you envision. Person's names are not unique. So that means that you have to allow the user to add a duplicate if he needs to. You also have to worry about typos and partial names. Arthur W. Jones doesn't match Arthur W Jones or Arthur Jones so if you are mushing the name into a single field - which I wouldn't do - you also need to prevent them from entering punctuation.
 

Users who are viewing this thread

Back
Top Bottom