Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    cluendo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    12
    Here are some pictures:



    Here you can see all forms and Tables:



    Here You can see the MAIN form:



    Here I enter data which is not in thelist, so PopUp dialog occurs( NOTE THE NAME I HAVE ENTERED) :



    Here you can see the dialog form to enter the details of the new record:
    Look how it represents the Last name?



    Finally if I click on "SAVE AND CLOSE" what I get is a Blank combo instead of the record:





    Maybe someone will get an Idea of what I want to achieve..

    Here is code on second form OnLoad event:
    Code:
    If Not IsNull(OpenArgs) Then
            DoCmd.GoToRecord acDataForm, "Patients", acNewRec
            Me.LastName = Left(OpenArgs, Len(OpenArgs) - (InStr(OpenArgs, " ") + 1))
            Me.FirstName = Right(OpenArgs, Len(OpenArgs) - (InStr(OpenArgs, " ")))
    End If
    It kind of works, but it sometimes messes up the LastName value, as you can see in one of the pictures I provided...Need a fix for that.



    The NotInList code looks like working properly at the momnet!
    Code:
    Private Sub PatientLook_NotInList(NewData As String, Response As Integer)
    On Error GoTo Err_PatientLook_NotInList
      
    Dim intAnswer As Integer
      
    intAnswer = MsgBox("Would you like to add this value to the list?", vbYesNo, vbQuestion)
    If intAnswer = vbYes Then
    DoCmd.RunCommand acCmdUndo
    DoCmd.OpenForm "Patients", , , , acFormAdd, acDialog, NewData
    
    Me![PatientLook].Requery
    
    Response = acDataErrAdded
    Else
    Response = acDataErrContinue
    End If
      
    Exit_PatientLook_NotInList:
    Exit Sub
      
    Err_PatientLook_NotInList:
    MsgBox Err.Description
    Resume Exit_PatientLook_NotInList
    End Sub

    Now how to make the value of the combo box stay the same I entered? You can see in the last picture - its gone.

  2. #17
    cluendo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    12
    anyone ?

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

Similar Threads

  1. Replies: 2
    Last Post: 06-20-2010, 06:54 PM
  2. Copy record to different table
    By Patience in forum Access
    Replies: 27
    Last Post: 06-03-2010, 12:19 PM
  3. table name as record
    By stigmatized in forum Access
    Replies: 1
    Last Post: 11-23-2009, 04:34 AM
  4. Move a record from one table to another table.
    By botts121 in forum Programming
    Replies: 4
    Last Post: 06-25-2009, 12:53 PM
  5. Checking a record in a table
    By widstje in forum Programming
    Replies: 4
    Last Post: 11-07-2007, 11:28 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