Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    @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?

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,859
    Quote Originally Posted by templeowls View Post
    @Gicu the first query is asking for a parameter for the Secondary field...I'm confused
    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

  3. #18
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    templeowls

    Could you not just use a calculated field in a query. Perhaps:
    Tel: IIf(IsNull([primary]),[Secondary],[Primary])

    See attached db
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #19
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    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,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #20
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    No it is not. If you are going to try coding you have to look carefully at the code and the values?
    I am new to this. There's no reason to be mean. I missed the spelling mistake just like Vlad. Thank you

  6. #21
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    @Gicu that worked!! I really do appreciate the help. Thank you so much. I'm sorry for frustrating everyone.

  7. #22
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    No worries, glad to hear you got it!
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #23
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,859
    Quote Originally Posted by templeowls View Post
    @Gicu that worked!! I really do appreciate the help. Thank you so much. I'm sorry for frustrating everyone.
    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

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Leave one field blank in pull-down menu
    By snowboarder234 in forum Access
    Replies: 8
    Last Post: 03-12-2018, 01:32 PM
  2. Replies: 2
    Last Post: 01-03-2017, 03:27 PM
  3. Replies: 6
    Last Post: 09-10-2013, 08:37 AM
  4. Replies: 1
    Last Post: 07-12-2013, 01:48 PM
  5. Replies: 2
    Last Post: 02-22-2012, 02:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums