Page 6 of 6 FirstFirst 123456
Results 76 to 89 of 89
  1. #76
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43

    Could anyone tell me why it will not close the form when clicking yes/ I have moved the DoCmd.Close around in all kinds of places and have also used
    Code:
    DoCmd.Close acForm, "frmRecieveOrd", acSaveYes
    and still couldn't get it to close
    Code:
    Private Sub cmdSubmit_Click()DoCmd.Beep
    Dim intResponse As Integer
    intResponse = MsgBox("Do you want to update the quantities and exit?", vbQuestion + vbYesNo, "Save and Exit")
    
    
    If intResponse = vbYes Then
    Dim rsUpdate As DAO.Recordset
    Set rsUpdate = CurrentDb.OpenRecordset("Inventory", dbOpenDynaset)
    With rsUpdate
    .FindFirst "[Cookie] = 'Samoas'"
    .Edit 'Samoas
    ![InStock] = ![InStock] + intSamoas
    .Update
    
    
        .FindFirst "[Cookie] = 'Tagalongs' "
        .Edit 'Tagalongs
        ![InStock] = ![InStock] + intTagalongs
        .Update
        
            .FindFirst "[Cookie] = 'Thinmints'"
            .Edit 'Thinmints
            ![InStock] = ![InStock] + intThinmints
            .Update
            
                .FindFirst "[Cookie] = 'Do_Si_Dos'"
                .Edit 'DoSiDos
                ![InStock] = ![InStock] + intDoSiDos
                .Update
                
                    .FindFirst "[Cookie] = 'Trefoils'"
                    .Edit 'Trefoils
                    ![InStock] = ![InStock] + intTrefoils
                    .Update
                    
                        .FindFirst "[Cookie] = 'Cookie = 'SavannahSmiles'"
                        .Edit 'savannahSmiles
                        ![InStock] = ![InStock] + intSavannahSmiles
                        .Update
                        End With
                        DoCmd.Close
        Set rsUpdate = Nothing
    End If  'User answered yes
    
    
    
    
    
    
    
    
    
    
    
    
    End Sub

  2. #77
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Why are you trying to save the design of the form?

    I use Docmd.Close

    in RunTime

  3. #78
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43

    POS form set up

    Where should the DoCmd.Close go? Everywhere I tried would either close the form and not update values or update values and not close

  4. #79
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Code looks good to me.

    Step debug. Refer to link at bottom of my post for debugging guidelines.
    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.

  5. #80
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    This would be problematic. Is this how it is in the database?

    Code:
                        .FindFirst "[Cookie] = 'Cookie = 'SavannahSmiles'"
                        .Edit 'savannahSmiles
                        ![InStock] = ![InStock] + intSavannahSmiles
                        .Update
    Also, I should have not phrased my previous post that way. Rather...

    This will not do anything for your recordset
    DoCmd.Close acForm, "frmRecieveOrd", acSaveYes


    If you want to save a record, close the form or navigate to a new record.
    Here is an example of closing a form and saving the current record
    DoCmd.Close acForm, "frmRecieveOrd"

    Or you can save a record via code like this
    if me.dirty then me.dirty = false

  6. #81
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43
    What I posted above is what is exactly in the db.

    I tried that
    DoCmd.Close acForm, "frmRecieveOrd"
    and didn't do anything. I put it at the ed of the "End With" and the "End If" with no luck.

    Also I tried the debug all I get is *Ding* and it doesn't step into anything.

  7. #82
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Did you run Debug > Compile?

    Is the procedure declaration really like:

    Private Sub cmdSubmit_Click()DoCmd.Beep

    That should be two lines, not one.
    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. #83
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43

    POS form set up

    I have done compile before yes. And no it should be two lines. I will double check and make sure but it should be two.

  9. #84
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43
    yupp two lines

  10. #85
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    One last thing to check before providing your latest version.

    Does the button Click event property say [Event Procedure]?
    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.

  11. #86
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43

    POS form set up

    I just decided to download the last copy that I uploaded here and change some stuff in it.

    Also got the VBA wizard working again, thank God that I no longer have to deal with 5 windows popping up and telling me the same thing for the billionth time.

    After rearranging and shrinking the cookies I have a good sized area of nothingness that I am trying to figure out what to do with. (I am thinking of leaving it empty and see how well it works with my tablet (using Teamviewer))

  12. #87
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43
    Aight I get a Runtime error 2407. It refers to this set of coding, Line 1 to start.

    Code:
     Me.Image0.Visible = Not Me.InvenSamoas = 0Me.Image14.Visible = Not Me.InvenThinmints = 0
    Me.Image16.Visible = Not Me.InvenTrefoils = 0
    Me.Image19.Visible = Not Me.InvenTagalongs = 0
    Me.Image21.Visible = Not Me.InvenDoSiDos = 0
    Me.Image24.Visible = Not Me.InvenSavannahSmiles = 0

  13. #88
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    That should be two lines.
    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.

  14. #89
    tristandoo is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    43

    POS form set up

    Ignore the code it didn't past right and I figured it out

Page 6 of 6 FirstFirst 123456
Please reply to this thread with any new information or opinions.

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