Invalid procedure call or arguement

R

Radhika

I have two fields of interest of a form:
1. NoProblemPresent (Yes/No)
2. Problem Description (drop down)

I want 'Problem description to default to 'N/A' if 'NoProblemPresent' is
checked.

Here is what i did:
1. Create a drop down box for 'Problem Description' with N/A as one of the
options.
2. On the 'On Got Focus' even of the 'Problem Description' drop down add the
following code:
If Me.NoProblemPresent Then
Me.[Problem Description] = "N/A"
End If
End Sub

However, when i try to execute the event i get the following message:
'Invalid call or procedure'.

What am i doing wrong?

Thank you,
Radhika
 
M

Maurice

Radhika,

How is the combobox being filled. Did you type field values or are you using
a table or query to fill it. If it's that last one you must refer to a
numerical value when choosing the NA option (which number is NA, that's the
number you should refer to).
 
G

George

How about rethinking the use of a redundant field instead?

If there is a problem (yes) there WILL ALSO BE a description other than "NA"
If there is no problem (no), there WILL ALSO BE a dscription, i.e. "NA"

In other words, the yes/no field adds no useful information.

My suggestion would be to eliminate the yes/no field and simply select "N/A"
or any of the relevant "descriptions" from your list.

George
 
R

Radhika

The combo box is being filled by a value list, not a list from a table or
query.

Maurice said:
Radhika,

How is the combobox being filled. Did you type field values or are you using
a table or query to fill it. If it's that last one you must refer to a
numerical value when choosing the NA option (which number is NA, that's the
number you should refer to).
--
Maurice Ausum


Radhika said:
I have two fields of interest of a form:
1. NoProblemPresent (Yes/No)
2. Problem Description (drop down)

I want 'Problem description to default to 'N/A' if 'NoProblemPresent' is
checked.

Here is what i did:
1. Create a drop down box for 'Problem Description' with N/A as one of the
options.
2. On the 'On Got Focus' even of the 'Problem Description' drop down add the
following code:
If Me.NoProblemPresent Then
Me.[Problem Description] = "N/A"
End If
End Sub

However, when i try to execute the event i get the following message:
'Invalid call or procedure'.

What am i doing wrong?

Thank you,
Radhika
 

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