Record Navigation in subform

dbertanjoli

Registered User.
Local time
Today, 22:30
Joined
Sep 22, 2000
Messages
102
Hello,
I have two forms: Main form [called frmPatient] (with patient data) and subform [called frmImages] (with images) Some patient might have 2 or more images. I would like to have record navigation bar on this subform to show how many images each patient have (example to show 1 of 3 and to scroll through them). I would greatly appreciate any reply.

Many thanks,
Debbie
 
Just turn on the Navigation Buttons for the form.
 
Hello,
I can't it would be so confusing. I have to position it somewhere near the image control. This is a code I am using (on current on my subform) and I know I have to fix this line to count number of images related to each patient. Currently it count every entered image:
__________________________________________________________

Me![RecordCount] = "Property " & (recClone.AbsolutePosition + 1) & " of " & _
DCount("lngPropertyID", "tblProperties")
__________________________________________________________



' If this is a "New Record" then
' Disable the <Next>, <New>, <Last> buttons
' Enable the <First> and <Next> buttons
' Then Exit the procedure.
intNewRecord = IsNull(Me![lngPropertyID])
If intNewRecord Then
cmdFirst.Enabled = True
cmdNext.Enabled = False
cmdPrevious.Enabled = True
cmdLast.Enabled = False
cmdNew.Enabled = False
Me![RecordCount] = "New Record"
Me.lngPropertTypeID.SetFocus ' Set focus to the lngPropertTypeID if a "New Record"
Exit Sub
Else
' Else if this is not a new record
' Enable <New> and <Last> buttons
cmdNew.Enabled = True
cmdLast.Enabled = True
End If

' Make a clone of the recordset underlying the form so
' we can move around without affecting the form's recordset
Set recClone = Me.RecordsetClone

' Check to see if there are no records
' If so disable all buttons except for the <New> button
If recClone.RecordCount = 0 Then
cmdNext.Enabled = False
cmdPrevious.Enabled = False
cmdFirst.Enabled = False
cmdLast.Enabled = False
Else
' Synchronise the current pointer in the two recordsets
recClone.Bookmark = Me.Bookmark
' If there are records, see if recordset is on the first record
' If so, disable the <First> and <Previous> buttons
recClone.MovePrevious
cmdFirst.Enabled = Not (recClone.BOF)
cmdPrevious.Enabled = Not (recClone.BOF)
recClone.MoveNext
' And then check whether recordset is on the last record
' If so, disable the <Last> and <Next> buttons
recClone.MoveNext
cmdLast.Enabled = Not (recClone.EOF)
cmdNext.Enabled = Not (recClone.EOF)
recClone.MovePrevious
End If


Me![RecordCount] = "Property " & (recClone.AbsolutePosition + 1) & " of " & _
DCount("lngPropertyID", "tblProperties")

recClone.Close

Exit_Form_Current:
Exit Sub

Err_Form_Current:
If Err = 3021 Then
' Error 3021 means recordset is at Add New Record
' Enable <Previous> and <First> buttons
' Disable <Next> and <Last> buttons
cmdPrevious.Enabled = True
cmdFirst.Enabled = True
cmdNext.Enabled = False
cmdLast.Enabled = False
Resume Exit_Form_Current
Else
MsgBox Err.Description
Resume Exit_Form_Current
End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom