hi all
At the bottom of the form it shows record 1 of 10 for example, how do I show this on my actual form as I am removing this bottom bar and having my own footer instead
Create a label called "labRecCount".
Put the following code in the forms OnCurrent event.
Code:
If Me.NewRecord Then
Me.labRecCount.Caption = "New Record (" & Me.RecordsetClone.RecordCount & " existing records)"
Else
Me.labRecCount.Caption = "Record " & [CurrentRecord] & " of " & Me.RecordsetClone.RecordCount
End If
Public Function udfRecords(f As Form)
With f
udfRecords = .CurrentRecord & " of " & IIf(.NewRecord, .CurrentRecord, .Recordset.RecordCount)
End With
End Function
2. add an Unbound Textbox to your form.
on it's ControlSource:
=udfRecords([Form])
3. add code to the Current Event of the Form:
Code:
private sub form_current()
Me.UnboundTextboxName.Requery
end sub
Public Function udfRecords(f As Form)
With f
udfRecords = .CurrentRecord & " of " & IIf(.NewRecord, .CurrentRecord, .Recordset.RecordCount)
End With
End Function
2. add an Unbound Textbox to your form.
on it's ControlSource:
=udfRecords([Form])
3. add code to the Current Event of the Form:
Code:
private sub form_current()
Me.UnboundTextboxName.Requery
end sub