Simple VBA Issue

J

jahi

Hi

I am new to VBA and am attempting to update a table value based on a
value looked up in a combo box.

My VBA is as follows:

[Tables]![tblSpecialPrices]![Description] = [Forms]![frmSpecialPrice3]!
[fsubSpecialPrices3].Combo16.Column(1)

I keep getting error 438, with text 'Object doesn't support this
property or method'

I can't see where I have gone wrong, I assume it is because the second
column in my combo box that I refer to in my VB statement is not
stored anywhere after selecting the value?

If so, how do I store this value for later use?

Any help would be much appreciated.
 
J

John W. Vinson

Hi

I am new to VBA and am attempting to update a table value based on a
value looked up in a combo box.

My VBA is as follows:

[Tables]![tblSpecialPrices]![Description] = [Forms]![frmSpecialPrice3]!
[fsubSpecialPrices3].Combo16.Column(1)

I keep getting error 438, with text 'Object doesn't support this
property or method'

I can't see where I have gone wrong, I assume it is because the second
column in my combo box that I refer to in my VB statement is not
stored anywhere after selecting the value?

If so, how do I store this value for later use?

Any help would be much appreciated.

The problem is the [Tables]! syntax. You simply cannot reference a table in
this manner - there is no Tables collection in this context.

What is the context? Is the Form based on tblSpecialPrices or on some other
table? Are you trying to update an existing record in tblSpecialPrices - if
so, which record?

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top