Subform .........please help

sajidaziz

New member
Local time
Today, 15:50
Joined
Aug 27, 2005
Messages
6
my main form has CustID, name, address etc..i have a subform having the fields CustID, Receipt# .....to add new record on subform for the same custID i want a command button on main form.....when i click on the button.....focus should go to on subforms last receipt# + 1....
is it possible??????????
 
Me("SubFormName").SetFocus
DoCmd.GoToRecord , , acNewRec

...should do it
 
thanx dear it works.....but problem is still there...
i want last receipt# plus one (Last record + 1)
 
Try something like this <<air code>>
Code:
Dim NewReceipt As Integer
Me("SubFormName").SetFocus
DoCmd.RunCommand acCmdRecordsGoToLast
NewReceipt = [Receipt#] + 1
DoCmd.RunCommand acCmdRecordsGoToNew
[Receipt#] = NewReceipt
 

Users who are viewing this thread

Back
Top Bottom