Checkbox Value

G

Guest

Hi I have a form bound to a table tblsales. On the form is a combo box which
pulls information from tblpurchases. This information is then used to
populate unbound text boxes.
One of the values pulled from tblpurchases is from a checkbox control on
another form, so the value stored is -1. This value is not being populated
into the appropriate text box on the form frmsales. I have tried changing the
control on frmsales to a checkbox to see if this was the problem.
The field in tblpurchases is formatted as a number field.
The format of the text box on frmsales is also number.
The code I am using is below

Private Sub stockno_AfterUpdate()
Text34.Value = stockno.Column(1)
Text36.Value = stockno.Column(2)
Text38.Value = stockno.Column(3)
Text40.Value = stockno.Column(4)
Text46.Value = stockno.Column(5)
Text48.Value = stockno.Column(6)
Text54.Value = stockno.Column(7)
End Sub
The query related to the combo box 'stockno' does pull the value correctly.

Has anyone any thoughts as to why this field is not being populated
 
D

Dirk Goldgar

In
richard said:
Hi I have a form bound to a table tblsales. On the form is a combo
box which pulls information from tblpurchases. This information is
then used to populate unbound text boxes.
One of the values pulled from tblpurchases is from a checkbox control
on another form, so the value stored is -1. This value is not being
populated into the appropriate text box on the form frmsales. I have
tried changing the control on frmsales to a checkbox to see if this
was the problem.
The field in tblpurchases is formatted as a number field.
The format of the text box on frmsales is also number.
The code I am using is below

Private Sub stockno_AfterUpdate()
Text34.Value = stockno.Column(1)
Text36.Value = stockno.Column(2)
Text38.Value = stockno.Column(3)
Text40.Value = stockno.Column(4)
Text46.Value = stockno.Column(5)
Text48.Value = stockno.Column(6)
Text54.Value = stockno.Column(7)
End Sub
The query related to the combo box 'stockno' does pull the value
correctly.

Has anyone any thoughts as to why this field is not being populated

Make sure you've set the Column Count property of the combo box to the
number of columns returned by the query. Also make sure you're
subscripting the .Column property for stockno correctly in your code,
allowing for the fact that the combo box's first column is .Column(0),
the second is .Column(1), and so on.

Are you saying that the value from the combo column isn't showing up in
the text box after you select the stockno? Or does it appear in the
text box but not get saved in the table? If the latter, I'd check that
the text box is correctly bound to the desired field in the form's
recordsource.

Your text box names, "Text34" and so on, aren't very informative. I'd
rename them, if I were you.
 

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