Hi Everyone,
I am trying to get a database working that was written by an old colleague of mine and worked perfectly well on Access 2000. I am now working on Access 2003 and part's of the database are no longer working, I presume because of the new version??
There seems to be a common point in which things are failing to work and is around VBA code that contains me.datelogged.value, example below:
frmCustomerdetails runs the following code on load and gets stuck at highlighted text:
Private Sub Form_Load()
Dim D As Date
Dim rst As Recordset, strCriteria As String
strCriteria = "[JobNumber] = " & gJobNumber
Set rst = Me.RecordsetClone
rst.FindFirst strCriteria
If rst.NoMatch Then
Debug.Print "frmCustomerDetails: No entry found"
Me.Bookmark = rst.Bookmark 'Temp
Else
Me.Bookmark = rst.Bookmark
End If
' Set date
D = rst!Job_DateLogged
If Not IsNull(D) Then
Me.DateLogged.Value = D
Else
Me.DateLogged = Now
End If
StageID = 1
SetMarginText (StageID)
End Sub
I am in no way a VBA whiz so bit stumped as to what is making this fall over? I've checked my references and it's not flagging any up as missing.
Any ideas anyone? Can anyone tell me what this bit of code actually does?
I am trying to get a database working that was written by an old colleague of mine and worked perfectly well on Access 2000. I am now working on Access 2003 and part's of the database are no longer working, I presume because of the new version??
There seems to be a common point in which things are failing to work and is around VBA code that contains me.datelogged.value, example below:
frmCustomerdetails runs the following code on load and gets stuck at highlighted text:
Private Sub Form_Load()
Dim D As Date
Dim rst As Recordset, strCriteria As String
strCriteria = "[JobNumber] = " & gJobNumber
Set rst = Me.RecordsetClone
rst.FindFirst strCriteria
If rst.NoMatch Then
Debug.Print "frmCustomerDetails: No entry found"
Me.Bookmark = rst.Bookmark 'Temp
Else
Me.Bookmark = rst.Bookmark
End If
' Set date
D = rst!Job_DateLogged
If Not IsNull(D) Then
Me.DateLogged.Value = D
Else
Me.DateLogged = Now
End If
StageID = 1
SetMarginText (StageID)
End Sub
I am in no way a VBA whiz so bit stumped as to what is making this fall over? I've checked my references and it's not flagging any up as missing.
Any ideas anyone? Can anyone tell me what this bit of code actually does?