Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2014
    Posts
    7

    Unanswered: Retrieving data from a recordset

    Hi. I'm very new to the Access / VBA world and am currently working on a database for work. I'm having difficulty in recalling data typed as checkboxes after it's been saved. I've tried a couple of different things but it doesn't seem to work. I can save the data with no problem, but I need the user to be able to recall it in case of an error. Can anyone provide an example of the coding for something like this? Please let me know if you need further information. Thanks.

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    So the checkboxes on the form save data to the table?
    (they usu save as YES/NO)
    And you want to open a query based on these checkbox fields?

  3. #3
    Join Date
    Apr 2014
    Posts
    7
    As of now, the check boxes are saving to the table as just check boxes. They are recording deficiencies found during an inspection. When you look at the data in the table, it's just a check mark in the column but the datatype is set to "Yes/No". I need to be able to pull the data from the table and re-populate the check boxes in case an error is made after it's saved. I hope this helps. Thanks.

  4. #4
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    I'm still cloudy on your method...
    do you want the user to check the boxes on an entry screen / entry table,
    then post that entry to the main data?

    But if you ARE posting directly into the main data tbl, what do you want to do?

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by jsweeney76 View Post
    As of now, the check boxes are saving to the table as just check boxes. ... When you look at the data in the table, it's just a check mark in the column but the datatype is set to "Yes/No".
    No: When you use Access interface to define a column in a table as Yes/No, you actually define the column as of Boolean data type which means that it can contain -1 (True), 0 (False) and possibly Null. The way the data is displayed when you open a table depends on the format set on the column. You define this format in the lower part of the interface when the table is open in definition view. The choices are: True/False, Yes/No, Active/Inactive in the General tab. Now if you open the other tab you can select the display control among Checkbox, Textbox and Combobox. If you select Textbox then open the table, you'll see that the values actually are shown as True/False that turn to 0 or -1 when you click in a field.
    Quote Originally Posted by jsweeney76 View Post
    I need to be able to pull the data from the table and re-populate the check boxes in case an error is made after it's saved. I hope this helps. Thanks.
    You can, without any problem retrieve the value of a Yes/No column (through a Recordset for instance) and use an expression such as:
    Code:
    Me.CheckBox_Status.Value = rst!Status
    Have a nice day!

  6. #6
    Join Date
    Apr 2014
    Posts
    7
    Excellent. Had to do very little tweaking but it works great. Thanks again.

  7. #7
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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