AfterExit Event on cbobox causing missing parameter box

R

R. Choate

I have a simple form created by the wizard. It is a straight form, named "frmEnter", based on a single table, named "tblIn". I added
a cbobox, named "cboOwner", with rowsource "SELECT DISTINCT tblIn.Owner FROM tblIn ORDER BY tblIn.Owner; I also have a textbox on
the form, simply named "Owner", and it is bound to the field named "Owner".

When I open the form and select an owner from the cbobox, I get a box in my face that has the owner's name I chose on it, and a box
for me to type something in. I don't understand why the box is coming up and what it wants. I have this based on another form with
nearly the exact same select statement, and works perfectly. I have compared the properties of both forms and both tables, and I
have only found one difference. The working form is based on a table with a unique, autonumber field. The non-working form is based
on a table where the owner is not unique and there is no unique field.as of yet.

I really need to fix this fast. Please slap me in the face and help me. I'm desperate.

Thanks in advance!
 
D

Dirk Goldgar

R. Choate said:
I have a simple form created by the wizard. It is a straight form,
named "frmEnter", based on a single table, named "tblIn". I added a
cbobox, named "cboOwner", with rowsource "SELECT DISTINCT tblIn.Owner
FROM tblIn ORDER BY tblIn.Owner; I also have a textbox on the form,
simply named "Owner", and it is bound to the field named "Owner".

When I open the form and select an owner from the cbobox, I get a box
in my face that has the owner's name I chose on it, and a box for me
to type something in. I don't understand why the box is coming up and
what it wants. I have this based on another form with nearly the
exact same select statement, and works perfectly. I have compared the
properties of both forms and both tables, and I have only found one
difference. The working form is based on a table with a unique,
autonumber field. The non-working form is based on a table where the
owner is not unique and there is no unique field.as of yet.

I really need to fix this fast. Please slap me in the face and help
me. I'm desperate.

Thanks in advance!

What code or macros are specified for the combo box's AfterUpdate,
OnClick, or OnChange event properties?
 
R

R. Choate

I'm sorry, I meant to include that and forgot.

Private Sub cboOwner_AfterUpdate()
DoCmd.ApplyFilter , "Owner = " & Me.cboOwner
End Sub

Thanks.
--
RMC,CPA


R. Choate said:
I have a simple form created by the wizard. It is a straight form,
named "frmEnter", based on a single table, named "tblIn". I added a
cbobox, named "cboOwner", with rowsource "SELECT DISTINCT tblIn.Owner
FROM tblIn ORDER BY tblIn.Owner; I also have a textbox on the form,
simply named "Owner", and it is bound to the field named "Owner".

When I open the form and select an owner from the cbobox, I get a box
in my face that has the owner's name I chose on it, and a box for me
to type something in. I don't understand why the box is coming up and
what it wants. I have this based on another form with nearly the
exact same select statement, and works perfectly. I have compared the
properties of both forms and both tables, and I have only found one
difference. The working form is based on a table with a unique,
autonumber field. The non-working form is based on a table where the
owner is not unique and there is no unique field.as of yet.

I really need to fix this fast. Please slap me in the face and help
me. I'm desperate.

Thanks in advance!

What code or macros are specified for the combo box's AfterUpdate,
OnClick, or OnChange event properties?
 
D

Dirk Goldgar

R. Choate said:
I'm sorry, I meant to include that and forgot.

Private Sub cboOwner_AfterUpdate()
DoCmd.ApplyFilter , "Owner = " & Me.cboOwner
End Sub

You need to put the value you get from the cboOwner combo box into
quotes:

DoCmd.ApplyFilter , "Owner = " & _
Chr(34) & Me.cboOwner & Chr(34)
 
R

R. Choate

I don't think I would have ever caught that. Such an obvious but subtle difference. In the old form, I had a numeric value in the
cbobox, but in the current form, it was text. I wish I had written earlier.

Thanks !

--
RMC,CPA


R. Choate said:
I'm sorry, I meant to include that and forgot.

Private Sub cboOwner_AfterUpdate()
DoCmd.ApplyFilter , "Owner = " & Me.cboOwner
End Sub

You need to put the value you get from the cboOwner combo box into
quotes:

DoCmd.ApplyFilter , "Owner = " & _
Chr(34) & Me.cboOwner & Chr(34)
 

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