MDB to ADP/SQL

  • Thread starter Thread starter Randy Shaw via AccessMonster.com
  • Start date Start date
R

Randy Shaw via AccessMonster.com

I want to use the following VBA code form and Access MDB in an Access ADP.
What is the correct syntax for T-SQL?

Private Sub Form_Current()

Dim rs As DAO.Recordset

Set rs = Me.Recordset
rs.Edit
rs("PolicyExpireDate") = Me.Text12
rs.Update

End Sub

I am writting the value in Text12 to the filed Poiicy Expire Date and get
and vba erro code
 
Why are you trying to edit the recordset of a bound form instead of changing
the value directly into the control?

I'm not sure if you can retrieve a DAO recordset for an ADP form if you have
not set the Recordset property of the form to a DAO recordset. By default,
it's an ADO recordset which is created and you should try with ADO.Recordset
instead. However, directly editing the recordset of a bound form can lead
to serious trouble.
 
I have a field on my form (say [field2]) and it is always one year after
the first Field (say [filed1]) I need to Sort, Report and have the field on
a form. I want to use this value In Reports and for sorting reports and
exports to excel. If I store (write) the value to {Filed1] I can then get
it in my stored procedure, reports and sorts.
 
Back
Top