+ Reply to Thread
Results 1 to 10 of 10

Invalid Qualifier

  1. #1
    Registered User
    Join Date
    03-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Invalid Qualifier

    My code:
    Please Login or Register  to view this content.
    The name of the combo boxes and text boxes are changed to the ones written above.
    ie. the drugcode combobox is named drugcode

    1. Somehow i keep getting an invalid qualifier for DrugCode = CInt(DrugCode.Value) and Price = CDbl(Me.Price.Value).
    2. before I added the Me. in front of the LastName.text I kept getting an invalid qualifier error as well. What does the Me. do?
    Last edited by DrowingInVBA; 03-18-2013 at 12:26 PM.

  2. #2
    Registered User
    Join Date
    03-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Invalid Qualifier

    Please Login or Register  to view this content.
    Now it throws an additional error that the method and data member cannot be found
    But the name of the combobox is DrugCode

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Invalid Qualifier

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    03-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Invalid Qualifier

    MKDRUGEdit.xlsxWorkbook1.xlsm
    This is the after^^

    The only thing that changed (when it stopped working) was the addtion of the submit button

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Invalid Qualifier

    The combobox on PurchaseForm is called 'DrugCode2' not 'DrugCode'.

    Also, on that form there is a textbox called 'Quantity' but in the code you have 'UnitsTextBox' in the Change event of that textbox, should that actually be 'Quantity'?

    Another problem, there is no named range DrugCodeList in either workbook.

    All of these things caused errors when I tried to open your forms.

    If I change 'DrugCode' to 'DrugCode2', change 'UnitsTextbox' to 'Quantity and change the code to populate the combobox to this,
    Please Login or Register  to view this content.
    I can open the purchase form.

    I've just realised the code you posted for the submit button is for the SalesForm, so I've been looking at the wrong form.:oops:

    The only problem I can see with that form is the DrugCodeList named range not existing.

    Mind you it's getting late and I've been looking at the wrong form for half an hour.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Invalid Qualifier

    don't use variables with the same names as your controls since it confuses the compiler. rename the variables and the invalid qualifier issue should be resolved
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  7. #7
    Registered User
    Join Date
    03-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Invalid Qualifier

    Hi thanks guys the problem was with my naming of my variables

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Invalid Qualifier

    What about the named range?

  9. #9
    Registered User
    Join Date
    03-16-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Invalid Qualifier

    my variables had the same name as the textboxes or comboboxes.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    When I tried to open the userforms the code failed because a named range (DrugCodeList?) wasn't found in the xlsx workbook.

    Did you fix that?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1