Solved Checkbox question (1 Viewer)

ProgramRasta

Member
Local time
Today, 08:43
Joined
Feb 27, 2020
Messages
98
Again a better explanation of exactly what you want to do would help to get more focused answers. Do you want to limit the selection to one record or multiple records? If one record the code is simple, if multiple its still easy but more complex.

example:

The last question on this if I may.

I want to pass the value from the first column within the listbox (on Form 2) to a text box on Form3 (Form 3 will be open) .

The code I was trying to implement is

Me.Listbox0.Columns(0) = [Forms]![Form3].TxtBoxName

However, I'm getting runtime error 424 with the above code.

Many Thanks.
 

bob fitz

AWF VIP
Local time
Today, 08:43
Joined
May 23, 2011
Messages
4,726
In post#17 I suggested using the AfterUpdate event of the listbox. On reflection, I think its Double Click event might be better.
 

ProgramRasta

Member
Local time
Today, 08:43
Joined
Feb 27, 2020
Messages
98
In post#17 I suggested using the AfterUpdate event of the listbox. On reflection, I think its Double Click event might be better.

Thanks for the reply, I have it in the on click event. There's something I'm obviously missing!

These are elementary questions but I'm a vba novice.

Thanks
 

bob fitz

AWF VIP
Local time
Today, 08:43
Joined
May 23, 2011
Messages
4,726
Thanks for the reply, I have it in the on click event. There's something I'm obviously missing!

These are elementary questions but I'm a vba novice.

Thanks
Click or Double click would be fine, I think, just not in the After Update that I originally suggested :)
 

ProgramRasta

Member
Local time
Today, 08:43
Joined
Feb 27, 2020
Messages
98
Click or Double click would be fine, I think, just not in the After Update that I originally suggested :)

Thanks :)

Do you have any suggestions on why the code above isn't working? I've posted the run time error that I'm getting. I'm just trying to pass the value in the listbox to a textbox in another form. the other form has an unbound textbox in it.
 

bob fitz

AWF VIP
Local time
Today, 08:43
Joined
May 23, 2011
Messages
4,726
Thanks :)

Do you have any suggestions on why the code above isn't working? I've posted the run time error that I'm getting. I'm just trying to pass the value in the listbox to a textbox in another form. the other form has an unbound textbox in it.
I can't see any code but if you post some I may be able to comment :unsure:
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:43
Joined
Sep 21, 2011
Messages
14,216
The last question on this if I may.

I want to pass the value from the first column within the listbox (on Form 2) to a text box on Form3 (Form 3 will be open) .

The code I was trying to implement is

Me.Listbox0.Columns(0) = [Forms]![Form3].TxtBoxName

However, I'm getting runtime error 424 with the above code.

Many Thanks.
Well your assignment is the wrong way around?
 

Micron

AWF VIP
Local time
Today, 03:43
Joined
Oct 20, 2018
Messages
3,478
I think by that backwards assignment you've demonstrated one of the rare causes for the error: you may have two valid references, but you are trying to perform an invalid action on it - you cannot set the value of a listbox column (AFAIK)

@ProgramRasta, please always post the error number and at least an approximation of the message. There must be nearly three thousand of them and it would be nice if we didn't have to look them up when you post just the number. Thanks.
 

Users who are viewing this thread

Top Bottom