Combox Box with Subform

momoko

Registered User.
Local time
Today, 17:07
Joined
Oct 7, 2001
Messages
41
Hi,
I've a unbound combox field in main form, which upon select the subform should display the information. I tried this code but it gives me an error :

Dim strSQLSF As String

strSQLSF = " SELECT * FROM UT_table_EOM_UT "
strSQLSF = strSQLSF & " WHERE UT_Table_EOM_UT.Expr7 = '" & UTEOM_SEL & "'"

Me.UT_Table_EOM_UT_subform.Form.RecordSource = strSQLSF
Me.Requery

Run-time error 2001
You canceled the previous operations
 
Check your code, if the all names (fields, tables) are correct.
 
Yes I've ensure all fields and table is correct. This is working on other form but for this it is giving error which puzzle me.
 
Tried ! but gives me error that MS can't find the field. Are there any other method that I can use?
 
Why don't you use a querydef instead of building the SQL in code?
 

Users who are viewing this thread

Back
Top Bottom