@Welshgasman my issue is I just don't know how to do that and hence why I'm posting here. Could you provide an example database?
@Welshgasman my issue is I just don't know how to do that and hence why I'm posting here. Could you provide an example database?
No it is not. If you are going to try coding you have to look carefully at the code and the values?
Vlad had made a typing error and entered [Seconday] for the value to update the Primary. Amend that for the correct name and it will update the one row in that table.
Whether you need step 2 is up to you.
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
templeowls
Could you not just use a calculated field in a query. Perhaps:
Tel: IIf(IsNull([primary]),[Secondary],[Primary])
See attached db
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
What is the name of the field in your table?
This the the SQL, you need to adapt it for your own table name and field names:
UPDATE tblEmployee SET tblEmployee.[Primary] = [Seconday] WHERE (((tblEmployee.Primary) Is Null) AND ((tblEmployee.Secondary) Is Not Null));
I just noticed I had a spelling mistake, see above in bold, please replace with Secondary.
EDIT: I came here from the notification email from the OP and it didn't show me all the new responses grrrrr. sorry for reposting!
Cheers,
I am new to this. There's no reason to be mean. I missed the spelling mistake just like Vlad. Thank youNo it is not. If you are going to try coding you have to look carefully at the code and the values?
@Gicu that worked!! I really do appreciate the help. Thank you so much. I'm sorry for frustrating everyone.
No worries, glad to hear you got it!
Cheers,
You are not frustrating everyone, well at least not me. I am also not trying to be mean, just drawing your attention to detail.
All I am trying to point out if the intricacies of coding. Vlad made a typo,(even the experts can do that ) but if he had run the code he would have spotted the mistake.?
You are going to do it yourself, time and time again, so it would be wise to start learning now?
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba