[AccessD] A2003: Access Data Project Question

Darren D darren at activebilling.com.au
Sun Sep 16 22:19:07 CDT 2007


Hi All

 

Am trying to do an insert from an Access Project form (That connects to an SQL
2000 dB) using a Forms!Control reference and am getting the following error 

 

 

"Run Time Error 128 - The Name Forms! Is not permitted in this context. Only
Constants expressions, or variables allowed here. Column Names are not
Permitted"

 

Clearly the old fashioned way of referencing a form control is gone in access
Data Projects

 

When I click help on the error - I get a white blank screen - Pretty much how I
feel :-)

 

Any suggestions, work arounds or is there some proper way to do with with data
Acess Projects?

 

Many thanks

 

Darren

 

The code is 

          Dim rs As Object

          Dim con As Object

          Dim insSQL As String

    

         

    Set rs = CreateObject("ADODB.Recordset")

    Set con = Application.CurrentProject.Connection

      

    

    insSQL = "insert into TariffServices (TariffID, ServiceTypeCode) VALUES
(Forms!frm1_Tariff!txtTariffID,
Forms!frm3_TariffServices!cbo_luTariffServiceID)"

 

    

    rs.Open insSQL, con, 1, 3 '<========Fails here

    

   ' DoCmd.RunSQL insSQL ' Also tried this and that failed too

    

 




More information about the AccessD mailing list