[AccessD] A2003: Access Data Project Question

Charlotte Foust cfoust at infostatsystems.com
Mon Sep 17 10:17:10 CDT 2007


An ADP works with SQL Server and SQL Server knows zip about the UI
forms, so you can't use that construction in an ADP.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren D
Sent: Sunday, September 16, 2007 8:19 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] A2003: Access Data Project Question

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

    

 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list