Search results

  1. L

    Solved Compile error: ByRef argument type mismatch with STRING INPUT

    Thank you for this response. This has helped my understanding a lot!
  2. L

    Solved Compile error: ByRef argument type mismatch with STRING INPUT

    I only call the function once so far, so it's actually easier for me to keep track of variables that way for now. Different strokes for different folks, I guess
  3. L

    Solved Compile error: ByRef argument type mismatch with STRING INPUT

    I changed the first line of the function to Public Function CheckScanOut(ByVal varProductSerialNumber As String) As Boolean after reading about it on a forum. It seems to be working now, though I am not 100% sure of the logic behind this change.
  4. L

    Solved Compile error: ByRef argument type mismatch with STRING INPUT

    Hi all :) I have a production tracking database that creates a new record every time a product is scanned into & out of a warehouse. I need to error-proof the system so a MsgBox pops up when an employee tries to scan a product into a warehouse when it hasn't been scanned out of the previous. I...
  5. L

    Solved VBA Export to Excel Permissions

    Thank you for your help. That worked. Also noticed I was passing an invalid document name before (it contained "/" and ":"), which I have fixed now, thanks again!
  6. L

    Solved VBA Export to Excel Permissions

    Hi all :) I am trying to create a button that, when clicked, opens a file dialog so the user can choose where to have "tbl_Transaction_Master" exported from Access as an Excel spreadsheet. I am getting the following error when I try and export the Excel doc to my desktop (my desktop folder is...
  7. L

    Passing Variable (Long) to SQL WHERE clause in VBA

    Oka Okay, I see now. Sorry about that. I did not realise you could save an SQL statement to a variable and not enclose the entire thing in quotation marks. Note taken. Thanks again!
  8. L

    Passing Variable (Long) to SQL WHERE clause in VBA

    maxID works perfectly fine and has a value. It is only when I pass that value to the SQL statement that an error occurs. I did try your solution just in case, unfortunately I still get the same error though.
  9. L

    String Variable for DLookup Criteria

    So Sorry for my misunderstanding. It works now. Thank you so much for your help!
  10. L

    Passing Variable (Long) to SQL WHERE clause in VBA

    Hi all :) I am new to SQL in Access VBA, so I am unsure of some syntax. The code below is producing the following error at the "DoCmd.RunSQL (SQLForceScanOUT)" line: "Syntax error (missing operator) in query expression '[Transaction_ID]=&maxID&'" I imagine it has something to do with my...
  11. L

    String Variable for DLookup Criteria

    I can see the erro... Will give this a go anyway, thanks.
  12. L

    String Variable for DLookup Criteria

    Unfortunately still battling with the syntax error (I have no spaces), but that you for that other line of code- so much quicker!
  13. L

    String Variable for DLookup Criteria

    Hi all :) I have learned that the syntax for passing a string variable to dlookup criteria argument is the following: DLookup("[field-to-return]","table","[criteria-field]=' " & string-variable & " ' ") . I have tried to use this syntax to obtain "maxID" in the code below, however it returns an...
  14. L

    New Member

    Is it bad etiquette to repost threads in different forums? Don't want to offend anyone, haha
  15. L

    Solved DLookup Returning Null

    Awesome, working like a dream. Thanks CJ_London, I understand now!
  16. L

    Solved DLookup Returning Null

    Hi all :) I have worked extensively with Excel VBA, but am having some trouble with VBA in Access, I hope you can help. A user inputs a product's barcode on a form (frm_scan_IN) then I am using a DLookup to return the category for the product ("ProductCategory"), based on the first few...
  17. L

    Solved Print SQL Select Result in VBA

    Thank you very Thanks for the help! I ultimately opted to use DLookup instead though.
  18. L

    Solved Print SQL Select Result in VBA

    Thanks for the response. Unfortunately that produces a syntax error "Expected end of statement" at the line with "SQLPreceeding=SQLPreceeding & "WHERE..."I am not sure why as I am not familiar with SQL syntax in Access VBA...
  19. L

    Solved SQL Select Query in VBA- How to view results

    Hello :) I am new to VBA/ SQL in Access and require some help. I am designing a production tracking database that records the date and time when a product enters a new workstation/warehouse. I would like to run a query through VBA which takes the product serial number that a user scans in and...
  20. L

    Solved Print SQL Select Result in VBA

    Hello :) I am new to VBA/ SQL in Access and require some help. I am designing a production tracking database that records the date and time when a product enters a new workstation/warehouse. I would like to run a query through VBA which takes the product serial number that a user scans in and...
Top Bottom