The variable strReturnId at the end of this piece of code is created as a public variable in a module . However, when the SQL is run in the row source of a combo box it keeps coming back asking for the parameter instead of passing the value directly.
Can anyone please help!
Code:
SELECT DISTINCTROW [NewCouncil].[Address_No], [NewCouncil].[Streetname], [NewCouncil].[TWN], [NewCouncil].[PostCode], [NewCouncil].[Ward_ID], [NewCouncil].[CID], [NewCouncil].[OldCouncil_Id] FROM NewCouncil WHERE ((([NewCouncil].[StreetName]) Like [forms]![frmMain]![txtStreet] & "*") And (([NewCouncil].[Address_No]) Like [forms]![frmMain]![txtNo] & "*") And (([NewCouncil].[OldCouncil_Id])=strReturnId));
Can anyone please help!