I am enclosing all the code in this procedure, please let me know what you think, I really need to get this working.
as you will see the first part of the code works fine. The second if statement is what is causing the issue.
Private Sub cmdCloseApp_Click()
On Error GoTo Err_cmdCloseApp_Click...
comparing primary keys.
here's the code that works. the second if statement based on this one does not work. What I'm I missing?
If rstbl1.RecordCount > rstbl2.RecordCount Then
Set rsinsert = New ADODB.Recordset
rsinsert.Open strsql2, adConn, adOpenKeyset, adLockOptimistic
With rsinsert...
I have three tables I need to compare and if differnt then update. Table1 compares to table2 if differnt then update and it works. Table1 compare to table3 and I get nothing. Any ideas
No reason why I couldn't do the insert instead. Just thought the database would be less chunky without all the queries. But,I am open to new things, so let me give this a try and see how it works. Thanks for all your help everyone.
Interesting, however, this link states that it's only for open forms. how do I reference a closed form? or do all forms have to be open in order for code to run correctly?
no the form was not open when I got the error. is it possible that the default file format for the database is causing the issue? Mine says it's set to Access 2000 even though I am working in 2003.
Private Sub cmdCloseApp_Click()
On Error GoTo Err_cmdCloseApp_Click
Dim strContactID As String
Dim strContactqryID As String
Dim strTrainingqryID As String
Dim strAccreditqryID As String
Dim strTrainingID As String
Dim strAccreditID As String
Dim StrFName As String
Dim strLName As String...
It is, which does not explain why the code is blind to this form. this is the error I am getting. I have the DAO 3.6 library. "Run-time error '2450'. Microsoft Access can't find the form 'Trainingfrm' referred to in a macro expression or Visual Basic code.
Sorry yes I am using Access 2003. I thought if clicked on the form properties it would show you the form name above the actual control source. however, my database doesn't do this. so I am trying to figure out where to go to find the actual form name.
I had a working database that would check to see if the person was trained in an area and also any available personal information stored. Now I want to change some code but for some reason VB/Microsoft can't find one of the forms. It's there I can see it but the form name has changed. anyone...
Getting an error
error 2465 application-defined or Object-defined error when I close the form. does this have something to do with the Call Stamprecord not being triggered?
I had it on the BeforeUpdate() sub for the form. since that was not working I tried moving to the AfterUpdate still not working
Private Sub Form_AfterUpdate(Cancel as Integer)
Call StampRecord (Me, True)
end sub
ok tried replacing str=NetworkUserName() with strUser=environ("UserName") and it didn't work. It acts like the code is either being ignored or is not being triggered.
Here's the code.
Public Function StampRecord(frm As Form, Optional bHasInactive As Boolean = False) As Boolean
On Error GoTo Err_StampRecord
'Purpose: Stamp the user and date/time into the record.
'Return: True if successful.
'Argument: frm = the bound form to be...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.