1

I have a Access Form which contains a listbox (lstusers) with 7 columns in it (Row Source Type - value list)

I am able to enter the 1st row with a static heading in the list box. Also, I am able to import data in multiple rows with the command below:

me.lstusers.additem VariableA & ";" & me.lstusers.additem VariableB and so on up to the 6th column. The 7th column will be updated later on the process the string "Checked".

So what I am trying to do is that once row 1 is done checking, Column 7 on row #1 should be updated with the string "Checked" Then row #2 on so on.

My Code is: lstUsers.Column(everify, i) = "Checked"

Variable "everify" has a static enum value of 8 and the "i" being an integer variable changes in the For loop So it will be changed to - lstUsers.Column(8, 1) = "Checked"

But I get error "Object Required"

2
  • Please post the actual code (not just separate snippets) and format it as code. Commented Jul 17, 2018 at 14:57
  • Code is updated Commented Jul 17, 2018 at 15:17

1 Answer 1

1

https://msdn.microsoft.com/en-us/vba/access-vba/articles/listbox-column-property-access

You can use the Column property to refer to a specific column, or column and row combination, in a multiple-column combo box or list box. Read-only Variant.
(Emphasis mine)

So: you can read them, but you can't update the displayed values in listbox columns directly.
(That one gets an "Object required" error when trying is ... interesting.)

You'll have to rethink your approach.

Either update and re-assign the full value list string for every change.

Or use row source type "Table" and use a local table as data buffer, where you update the values, and then lstUsers.Requery.

My guess is that the latter would be cleaner code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.