ID Number on Forms are different...

  • Thread starter Thread starter Keith Bemis
  • Start date Start date
K

Keith Bemis

Hello, I hope someone can tell me what's wrong with my
database..I am using access 2000 and created a main form
for input of patients name and some insurance
information,,,the primary key is set to ID number that is
set to autonumber, well on the side of the main form are
buttons that popup subforms that may need to be filled out
depending on the type of patient I notice that data is
lost and dosn't appear because the autonumber of the main
form may be for example 60, and the subform ID will read
61 this is a new database and I thought it was working
earlier in the week but something weird happened below is
some code from the subform...thanks for any help I need to
have this working this week.
Keith Bemis

Private Sub PI_Patient_Ins__Click()
On Error GoTo Err_PI_Patient_Ins__Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PIPatIns"
stLinkCriteria = "ID =" & Me.ID
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_PI_Patient_Ins__Click:
Exit Sub

Err_PI_Patient_Ins__Click:
MsgBox Err.Description
Resume Exit_PI_Patient_Ins__Click
 
AutoNumbers and Record Counts are seldom, if ever, the same. It's very
common for there to be gaps in numbering with AutoNumbers, since if you
start entering data and change your mind, the AutoNumber value that would
have been used for the record is lost.

Realistically, AutoNumbers exist for one purpose only: to provide a
(practically guaranteed) unique value that can be used as a Primary Key.
Seldom, if ever, should your users even be aware of what the AutoNumber
value is.
 
Back
Top