Results 1 to 7 of 7
  1. #1
    Me.Howard is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    16

    Error checking

    I have a text box on a form into which I manually input a job number. It is imperitive this be a valid job number. I have a table of all valid job numbers. I have created a query from this job table which returns a valid matching job number from the job table. This works fine. I am trying to compare the text box job number to the returned job number from the query. My thought was to put the query returned number in a variable . Dim SaveValue as Integer. I haven't figured out how to put the query job number in the SaveValue variable. My purpose for doing this is to show message if they do not match. The query woks fine just not the move to the variable.

    Is there a better way to accomplish this?

    Any thoughts will help.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe you can use a combobox's Rowsource to retrieve a list of valid Job Numbers. Then, the user can select an option form the list provided by the combobox control.

  3. #3
    Me.Howard is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    16
    T^hats the way I have it functioning today. I am just trying to clean it up while I continue to learn.

  4. #4
    Me.Howard is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    16
    I have also used the Dlook for the Job name looking in the job table. I have a problem here in checking the JobName text box for a blank. The text box contains #Name? and I cant check for that either.

  5. #5
    Me.Howard is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    16
    The combo box approach is working. Guess I'll let it go with that.

    Thanks

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Me.Howard View Post
    ...The text box contains #Name? and I cant check for that either.
    This is likely associated with that text box control's Control Source property. If you want to bind it to a field, select an option from the Control Source property's pull-down.

    As for the combobox thing, the combo and the listbox are the go-to controls when you need to provide additional recordsets. If there is only one option you want to provide (a value for a simple data type), you can store that in a variable and or assign the value to an unbound control in another form. In other words, if the user does not have to choose a value, assign the desired value to something like a control and or a variable.

  7. #7
    Me.Howard is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2015
    Posts
    16
    Thanks Its Me, You have been a big help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error checking
    By Me.Howard in forum Forms
    Replies: 5
    Last Post: 10-15-2015, 04:06 PM
  2. Error Checking in a text box
    By Paul H in forum Forms
    Replies: 2
    Last Post: 07-23-2015, 01:02 PM
  3. Error Checking Boxes
    By CementCarver in forum Access
    Replies: 2
    Last Post: 06-12-2013, 04:27 PM
  4. Error Checking within Form
    By phd4212 in forum Forms
    Replies: 1
    Last Post: 05-09-2012, 02:46 PM
  5. Date error checking
    By oediaz in forum Programming
    Replies: 2
    Last Post: 03-26-2010, 12:08 PM

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