G
Guest
Hello,
can someone help me out. I'm trying to generate the VBA code for next problem:
With the Update event i try to generate a number out of a date and folowup
number. The dates and numbers are stored in a seperate table.
When starting the event (after update) i would like to look into the table
to find out if there are already records in it with the same date. If so, i
would like to know the highest number.
The problem i encounter is to find the right code to find a match. Here some
code i already wrote:
strSql = "select * from tbl_CertificateNr"
Set rstRecord = CurrentDb.OpenRecordset(strSql)
'"Go to last record"
If Not rstRecord.EOF Then
Me.Bookmark = rstRecord.Bookmark
Else
'"No records in this file"
End If
If rstRecord.EOF = True Then
'"Geen record gevonden"
Else
"Here is where the problem starts" ???????????????????????????
DoCmd.FindRecord M_date
If rstRecord!Date = M_date Then
'Already record available for this request date
M_lstNr = rstRecord!nr
M_date = rstRecord!Date
M_eof = False
Else
'No records available for this request date
End If
End If
'now, we can go:
can someone help me out. I'm trying to generate the VBA code for next problem:
With the Update event i try to generate a number out of a date and folowup
number. The dates and numbers are stored in a seperate table.
When starting the event (after update) i would like to look into the table
to find out if there are already records in it with the same date. If so, i
would like to know the highest number.
The problem i encounter is to find the right code to find a match. Here some
code i already wrote:
strSql = "select * from tbl_CertificateNr"
Set rstRecord = CurrentDb.OpenRecordset(strSql)
'"Go to last record"
If Not rstRecord.EOF Then
Me.Bookmark = rstRecord.Bookmark
Else
'"No records in this file"
End If
If rstRecord.EOF = True Then
'"Geen record gevonden"
Else
"Here is where the problem starts" ???????????????????????????
DoCmd.FindRecord M_date
If rstRecord!Date = M_date Then
'Already record available for this request date
M_lstNr = rstRecord!nr
M_date = rstRecord!Date
M_eof = False
Else
'No records available for this request date
End If
End If
'now, we can go: