Home > Archive > MS Access project with SQL Server > April 2005 > MDB to ADP/SQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MDB to ADP/SQL
Randy Shaw via AccessMonster.com

2005-04-25, 1:24 pm

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

--
Message posted via http://www.accessmonster.com
Sylvain Lafontaine

2005-04-25, 1:24 pm

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.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC


"Randy Shaw via AccessMonster.com" <forum@nospam.AccessMonster.com> wrote in
message news:b176642811e14dd
2ac787c977f58c509@Ac
cessMonster.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
>
> --
> Message posted via http://www.accessmonster.com



Randy Shaw via AccessMonster.com

2005-04-25, 8:25 pm

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.

--
Message posted via http://www.accessmonster.com
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com