Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Thanks for all your help I have everything working great and all problems solved. The only thing I could not get to work is when I add a new company using not in the list and the form pops up to enter new company information it all works but does not update the field on the main form (main form name "customer" field combo box "compID) If any one has any suggestions. thanks Angie

  2. #17
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Hi June7. I have read both links you gave me but so far I can't figure it out. I need the customer form to Requrey with the new compid information that is added when not in list. Also to update if any changes are made in the selected compid combo box. The dbl click opens the form and I can make the changes but it does not update the form with the combo box I have to choose the name again and them it will update. It will add a new record on not on list but again I have to use the comb box to select the new record before it will show the information. I would like it to updat with out choosing it again in the combo box. Thanks Angie.

  3. #18
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Need something to analyse.

    Post the relevant code or provide db.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232

    Attached db

    DB FOR ACCESS.zip

    Hi June7 I have attached a compressed file of my database I have tired to just include the tables and forms you will need to cut the size down. I hope it is what you need. thank you Angie

  5. #20
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Those two links weren't the ones I usually reference for this issue. Here is the one I usually go to http://www.blueclaw-db.com/access_no...ed_example.htm. I am sure there are many more if you do a search. The trick with your situation is need to pass the new CompID created in the autonumber field back to the customer form. Most examples don't seem to deal with that.

    Your code can be simple as:
    Code:
    Private Sub CompID_NotInList(NewData As String, Response As Integer)
        Response = acDataErrContinue
        Me.CompID = Null
        DoCmd.OpenForm "company owner NAME details", acNormal, , , acFormAdd, acDialog, NewData
        Me.CompID.Requery
    End Sub
    Code behind the company details form:
    Code:
    Private Sub Form_Current()
    If Not IsNull(Me.OpenArgs) Then
        Me![Company Or Owner] = Me.OpenArgs
        DoCmd.RunCommand acCmdSaveRecord
        Form_Customer.CompID.Requery
        Form_Customer.CompID = Me.ID
    End If
    End Sub
    Can have additional code for a MsgBox in the NotInList event to ask user if they really want to add new company record.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #21
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Hi June7, This worked great thank you so much. I also did the following code in the detail form, on after update
    Private Sub Form_AfterUpdate()
    DoCmd.RunCommand acCmdSaveRecord
    Form_Customer.CompID.Requery
    Form_Customer.CompID = Me.ID
    End Sub

    this updates the information for the customer record but it does not update for all customer with the same compID, should I make a query to update all records using the same compid if any changes are made. are is there a better way. I have never done this before but if I add something to the code above to update all records using the compid maybe activating a query ? not sure how to do it. Angie

  7. #22
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I don't understand why that code was needed.

    What do you mean by 'update all records using the same compid'? What needs to be updated? This has just created a new company record, how could there be 'other' records to update?

    The ID's of company and contractor should be saved as foreign keys in Customers but the associated company and contractor detail info should not also be saved.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #23
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    I think I had a brain melt down. Sorry after I thought about it I realized i was not thinking right... Everything is working great. Thank you so much for your help. Have a great day. Angie.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-15-2014, 10:03 PM
  2. Replies: 1
    Last Post: 05-22-2013, 09:32 PM
  3. Replies: 2
    Last Post: 02-19-2013, 07:47 AM
  4. Replies: 7
    Last Post: 09-06-2012, 02:08 PM
  5. sub form no longer linked to combo box
    By gbmarlysis in forum Forms
    Replies: 1
    Last Post: 03-04-2012, 12:25 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