[AccessD] Help with Combo Box

Dan Waters dwaters at usinternet.com
Tue May 27 15:01:08 CDT 2003


Ed,
 
Two very quick comments -
 
1) Use Me.Refresh instead of Me.Requery.  Me.Requery is only needed if you
have changed the query itself.  Me.Refresh is used when the underlying data
has changed and you just want to re-run the existing query or recordsource,
as in your case.  Access help goes into detail on the differences between
these two commands.
 
2)  If you have a 1 - Many relationship established between the
ComplaintGeneralCode fields in the two lookup tables, remove it.   
 
HTH,
Dan Waters

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tesiny, Ed
Sent: Tuesday, May 27, 2003 1:28 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Help with Combo Box



I have two combo boxes and I'm trying to limit the contents of the second
combo box based on the selection made in the first box.  I'm obviously doing
something wrong because the second combo box saving the value of the first
box in the table.

For the Row Source of the 2nd  combo box I have:

 

SELECT ComplaintGeneralCode, ComplaintSpecificDesc

FROM tblComplaintSpecific

WHERE ComplaintGeneralCode = Forms!SF_Complaints_New!cboComplaintGeneral;

 

For the 1st combo box I have:

 

Private Sub cboComplaintGeneral_AfterUpdate()

Me!cboComplaintSpecific.Requery

End Sub

 

Table tblComplaintGeneral has two fields: ComplaintGeneralCode (autonumber),
ComplaintGeneralDesc (text)

Table tblComplaintSpecific has 3 fields:  ComplaintSpecificCode
(autonumber), ComplaintGeneralCode (long integer), ComplaintSpecificDesc
(text)

 

In addition, when I try to close the form I get a parameter window asking
for a value for Forms!SF_Complaints_New!cboComplaintGeneral

 

Any help is greatly appreciated.

 

Ed

 
Edward P. Tesiny
New York State OASAS
Evaluation and Program Monitoring
1450 Western Ave.
Albany, New York  12203-3526
Phone:  (518) 485-7189
Fax:  (518) 485-5769
EdTesiny at oasas.state.ny.us
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030527/83f2dab3/attachment-0001.html>


More information about the AccessD mailing list