G
Guest
I'm still not getting anything to populate in the text box. Is there any
information that needs to be in the text box itself or does everything work
off the AfterUpdate event?
information that needs to be in the text box itself or does everything work
off the AfterUpdate event?
Douglas J. Steele said:So is it working now? Your latest post doesn't have any question in it...
Is the field name in table tblQualityDescript really cboProcess?
BTW, when referring to a control on the current form, you really should use
Me.[cboProcess], rather than simply [cboProcess]:
Private Sub cboProcess_AfterUpdate()
Me.txtDescription = DLookup("[Description]", "[tblQualityDescript]",
"[cboProcess]='" & Me.cboProcess & "'")
End Sub
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
WMorsberger said:Ok, I don't know if I messed everything up that I had. I had to go in and
change a few things on my tables and forms. I updated the code with the name
of the new fields that I have
here is what i have in the After Update box of the combo box that I need the
text to populate based off of
Private Sub cboProcess_AfterUpdate()
Me.txtDescription = DLookup("[Description]", "[tblQualityDescript]",
"[cboProcess]='" & [cboProcess] & "'")
End Sub
Now just in case you need to know this - I have 2 combo boxes on my form.
When you choose something from the 1st combo box then the 2nd only gives you
the drop down items that are based on the option from the first drop down. I
didn't think this would matter but I wanted to let you know. - I also created
another table that holds only the quality item and the description and that
is what I have the text box looking at. i hope this makes sense.
Thank you.
Douglas J. Steele said:When you first open the form? You haven't selected anything in the combobox
at that point.
Try putting code in the AfterUpdate event of the combobox:
Private Sub AMU_Monthly_Quality_Processes_AfterUpdate()
Me.MyTextBox = DLookUp("[Description]","[AMU 10% Monthly Quality
Processes]","[AMU Monthly Quality Processes]='" & [AMU Monthly Quality
Processes] & "'")
End Sub
Replace Me.MyTextBox with the name of the actual textbox in which you're
trying to display the value.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I have put the code in that you have - when I go to the form view I have
Error in the box and it's blinking - it's almost like it is trying to run
the
code but isn't finding anything to populate the box.
:
No, you haven't written it correctly. Since there are spaces (and
special
characters) in the table name, you need square brackets around it as
well:
=DLookUp("[Description]","[AMU 10% Monthly Quality Processes]","[AMU
Monthly
Quality Processes]='" & [AMU Monthly Quality Processes] & "'")
This assumes that AMU Monthly Quality Processes is a text field. If it's
numeric, lose the single quotes:
=DLookUp("[Description]","[AMU 10% Monthly Quality Processes]","[AMU
Monthly
Quality Processes]=" & [AMU Monthly Quality Processes])
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
This is the DLookUp statement that I am using and it is not returning
anything
=DLookUp("[Description]","AMU 10% Monthly Quality Processes","[AMU
Monthly
Quality Processes]='" & [AMU Monthly Quality Processes] & "'")
I'm not sure if I have it written correctly
Description = The field that I am trying to pull the information out
of
AMU 10% Monthly Quality Processes = The table that the information is
housed
in
AMU Monthly Quality Processes = The name of the combo box on the form
:
WMorsberger wrote:
Does anyone have any suggestions to what I might be able to do to
make
something like that work? I don't think I can fit everything i
need
to say into 255 characters.
Instead of grabbing the value from a ComboBox column use DLookup()
to
retrieve
the field. That should give you the whole thing.