Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / May 2005

Tip: Looking for answers? Try searching our database.

ADP Form not requering properly???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 04 May 2005 03:42 GMT
I have an ADP front-end and on click of a save button I run the following
code:

me.dirty = false
me.requery

But the form is not refreshing. If I close the form and then re-open it the
record appears correctly . Any ideas?
Sylvain Lafontaine - 04 May 2005 04:15 GMT
What are you trying to do exactly with these two lines of code?

Signature

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC

>I have an ADP front-end and on click of a save button I run the following
> code:
[quoted text clipped - 5 lines]
> the
> record appears correctly . Any ideas?
Jeff - 04 May 2005 15:15 GMT
I'm trying to save the record and refresh the form. The save is working
with they dirty method but it's not refreshing. I have to close the form
and re-open in order to view the record.

I also tried

Private Sub cmdSave_Click()

DoCmd.RunCommand acCmdSaveRecord
Me.Refresh
 
End Sub

But I get a message indicating "can't find the field forms"
Jeff - 04 May 2005 16:42 GMT
I think the problem is that my primary key is set to null when I start
entering data into a new record. So any method I try to run crashes. I have
several subforms on my main form as well. If I close the form and re-open
it the record appears correctly.
Sylvain Lafontaine - 04 May 2005 17:03 GMT
Having a primary key set to null shouldn't be a problem with ADP, if this
field is an identity field on the SQL-Server.  The form should insert the
new values and refresh the form automatically.

Usually, you don't need to use the Refresh command with bound forms, unless
you want to see edited values changed by other users or if you have made
change directly to the SQL-Server by using ADO objects or other ways.  If
you want to see not only changes to the currently displayed records in the
forms but new records that has been added as well, then the Requery command
should be used instead of Refresh.

However, in your case, the use of either the Refresh or the Requery command
shouldn't be necessary; even when using the DoCmd.RunCommand acCmdSaveRecord
procedure.  It if possible that your problem arises from something else.

Signature

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC

>I think the problem is that my primary key is set to null when I start
> entering data into a new record. So any method I try to run crashes. I
> have
> several subforms on my main form as well. If I close the form and re-open
> it the record appears correctly.
Jeff - 04 May 2005 18:48 GMT
If I try a simple "me.requery" I get a message indicating can't find the
field 'forms'... I had this same error when I had a trigger that appended
an identity field into another table with an identity field so I guess it
has something to do with that. I'll have to look further into what's
causing this.
Vadim Rapp - 04 May 2005 12:53 GMT
Hello,
You wrote on Wed, 04 May 2005 02:42:07 GMT:

JvA> I have an ADP front-end and on click of a save button I run the
JvA> following code:

JvA> me.dirty = false
JvA> me.requery

If something is dirty, you have to wash it, not just declare that it's
clean. If the record was changed, you have to either commit the changes to
the database, or cancel them.

Vadim Rapp
Jeff - 04 May 2005 21:11 GMT
I got it to work by setting the unique table property to table that's being
modified and the Resync Command.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.