Results 1 to 4 of 4
  1. #1
    simon123 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    12

    Opening a new form, with the same record ID

    Hi there folks, please go easy with a beginner.

    In my database, you can open a Client record and create an Enquiry in a form called frmEnquiriesNew – what I want, is a Save button, which closes the current form and opens the same record in a different form, frmEnquiries (which has a bit more functionality). The point is that users can't access all the features of frmEnquiries until they have added the basic information and saved the record.



    I have added the below code to a save button but when I use it, it just opens the frmEnquiries form with a completely different record. Is it obvious where I am going wrong here?

    Code:
    Private Sub cmdSaveEnquiry_Click()
    Dim EnqIDPass As Integer
     
            EnqIDPass = Me.Enquiry_ID.Value
           
           
            DoCmd.Close acForm, "frmEnquiriesNew"
            DoCmd.OpenForm "frmEnquiries", , "[Enquiry ID]=" & EnqIDPass
               
    End Sub
    Thank you for your help

    Simon

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You have the argument in the wrong position:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    simon123 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    12
    D'oh, thank you so much for the info and link (bookmarked)

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-24-2015, 12:59 AM
  2. Opening a Form from another record
    By robrien in forum Forms
    Replies: 2
    Last Post: 08-21-2013, 05:53 AM
  3. Opening a form for a particular record.
    By 86rainey in forum Forms
    Replies: 6
    Last Post: 06-24-2012, 10:14 AM
  4. opening a form with last one record.
    By cap.zadi in forum Forms
    Replies: 1
    Last Post: 01-17-2012, 12:45 AM
  5. Replies: 9
    Last Post: 09-16-2011, 03:52 PM

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