Combox Box with Subform (1 Viewer)

momoko

Registered User.
Local time
Today, 13:40
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
 

MStef

Registered User.
Local time
Today, 13:40
Joined
Oct 28, 2004
Messages
2,251
Check your code, if the all names (fields, tables) are correct.
 

momoko

Registered User.
Local time
Today, 13:40
Joined
Oct 7, 2001
Messages
41
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.
 

momoko

Registered User.
Local time
Today, 13:40
Joined
Oct 7, 2001
Messages
41
Tried ! but gives me error that MS can't find the field. Are there any other method that I can use?
 

neileg

AWF VIP
Local time
Today, 13:40
Joined
Dec 4, 2002
Messages
5,975
Why don't you use a querydef instead of building the SQL in code?
 

Users who are viewing this thread

Top Bottom