MDB to ADP/SQL

  • Thread starter Randy Shaw via AccessMonster.com
  • 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
 
S

Sylvain Lafontaine

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.
 
R

Randy Shaw via AccessMonster.com

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top