Vba setting control values (1 Viewer)

flaghippo

Registered User.
Local time
Today, 12:44
Joined
Jan 22, 2012
Messages
19
Hi All
I am using the code below to read into form control combo boxes.
Me.CUSTOMER.Value = EX_CUSTOMER
Me.Contact.Value = EX_CONTACT
Me.QTY.Value = EX_QTY

This works fine until I get to this code
Me.PAINTING.value = EX_PAINT

Strange thing is...
When I enter the line, after me.painting. the "value" text does not show automatically.

Does any one have any clues ??

Thanks
Flag
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:44
Joined
Jan 23, 2006
Messages
15,396
What error message do you get?
Can you show us all of the code in this related procedure?
 

flaghippo

Registered User.
Local time
Today, 12:44
Joined
Jan 22, 2012
Messages
19
Hi
The error is....
Compile error invalid qualifier.

Its seems to me the VBA code has lost its link with the control on the form.

I have tried .....
[formname].Form![controlname].SetFocus
and
[formname].Form![controlname].value = variable

Still the same code

Is the form corrupt I wonder

Thanks
Flag
 
Last edited:

boblarson

Smeghead
Local time
Today, 12:44
Joined
Jan 12, 2001
Messages
32,059
Are you absolutely sure that the combo is named PAINTING and not something else. If you have a FIELD named PAINTING and the control is NOT named the same, then trying to use .Value will generate an error.
 

flaghippo

Registered User.
Local time
Today, 12:44
Joined
Jan 22, 2012
Messages
19
Hi
The Control & Name are exactly the same.
Please see attachments .... (NOT SURE THESE ARE ATTACHED)


COMPILE ERROR:

INVALID QUALIFIER
 

The John Rambo

Baggins
Local time
Today, 22:44
Joined
Apr 7, 2011
Messages
19
Change the name of your PAINTING control to something else e.g. txtPAINTING.
There is a "Painting" property for forms which can only be set to TRUE or FALSE.
When you enter
Me.PAINTING.value = EX_PAINT
you refer to the property of the form and not the control.
 

Users who are viewing this thread

Top Bottom