J
Joe
On the form ClientInvesment there is an Add client button
that opens a different form. When you click Save, the new
client is being saved with an Auto Number.
On the form ClientInvesment I also have a Search button
and after updating it, it loads some of the client's
personal information and all investments for that client
ID.
Remember! Client ID is an Auto number.
How can I make the Search button should automatically
detect the new Auto number and fill the client's
information onto the ClientInvesment form?
Is there anyway, that I can capture an Auto number while
its being created?
Is there any code to put in this procedure?
Your help is appreciated.
Please let me know if you need additional clarifications.
Thanks
Joe
=========
Private Sub SaveMember(lngClientID)
Dim rs As ADODB.Recordset
Set cnn = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open "TblClients", cnn, adOpenStatic, adLockOptimistic
If lngClientID = 0 Then
rs.AddNew
Else
rs.Find "ClientID = " & lngClientID
If rs.EOF Then
Beep
MsgBox "can't find this record"
GoTo Exit_SaveMember
End If
End If
With rs
!FirstName = FirstName
!LastName = LastName
!Zip = Zip
..Update
End With
===============
that opens a different form. When you click Save, the new
client is being saved with an Auto Number.
On the form ClientInvesment I also have a Search button
and after updating it, it loads some of the client's
personal information and all investments for that client
ID.
Remember! Client ID is an Auto number.
How can I make the Search button should automatically
detect the new Auto number and fill the client's
information onto the ClientInvesment form?
Is there anyway, that I can capture an Auto number while
its being created?
Is there any code to put in this procedure?
Your help is appreciated.
Please let me know if you need additional clarifications.
Thanks
Joe
=========
Private Sub SaveMember(lngClientID)
Dim rs As ADODB.Recordset
Set cnn = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open "TblClients", cnn, adOpenStatic, adLockOptimistic
If lngClientID = 0 Then
rs.AddNew
Else
rs.Find "ClientID = " & lngClientID
If rs.EOF Then
Beep
MsgBox "can't find this record"
GoTo Exit_SaveMember
End If
End If
With rs
!FirstName = FirstName
!LastName = LastName
!Zip = Zip
..Update
End With
===============