dcsimg
Results 1 to 3 of 3
  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2018
    Posts
    52

    Resolved [RESOLVED] setting combobox value through VBA

    I would like the [Order Number] combobox to have the same value of [Order Number1] combobox after the user clicks yes or no in messagebox
    Name:  gsdgdfgsdfgsdg.jpg
Views: 125
Size:  23.0 KB

  2. #2

    Thread Starter
    Member
    Join Date
    Feb 2018
    Posts
    52

    Re: setting combobox value through VBA

    here is what i have for my code so far

    NOTE: Me.Combo960 = Me.Combo970 didnt work
    Code:
    'Me.Combo960 = Me.Combo970
        
        Answer = MsgBox("record added with order number " + Combo970.Value + " Do you wish to delete this record from Archive?", vbYesNo + vbExclamation + vbDefaultButton2, "Delete Confirmation")
    If Answer = vbYes Then
    DoCmd.SetWarnings False
        sql = "DELETE * FROM Archive WHERE [Order Number] = '" & Me![Combo970] & "'"
        CurrentDb.Execute sql

  3. #3
    Hyperactive Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    454

    Re: setting combobox value through VBA

    The documentation for this control describes how to get the result you want. The Adding Items section of the document also include code samples.
    Last edited by Arve K.; Feb 8th, 2018 at 03:08 PM.
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.