Hi,
I made up a nice little form which had its own sub form in it.
I made a litle VB code so that when I pressed a button it would move
form the form (frmConference) to the subform
(frmBookingBookingBased), start a new record, and copy some values
form the form into some fields in the subform, and then leave the
cursor sitting (in focus) at the begining of the subform.
I will list the VB code below.
The problem I am now having, and of which I don't have enough
experiene to work out by myself yet, is now I decided I actually want
to put the form (with its subform) into a another form (not linked to
it) inside a tab, so one of the tabs on this new form (frmMainForm)
will be my form I made up (frmConference).
The problem is that whenever I try that, and I press the button,
instead of geting a new record in the subform like I used to
(populated with the data I copied), instead I get a new record in the
form itself (frmConference).
So... can anybody help me work out how to convert my code from being a
form/subform code bit to a form/tabed subform/subform code bit?
Code in quesiton quoted below.
Private Sub btnDefaultConferenceEntry_Click()
' The point of this button is to make a new entry which copies the
' start and end date into the expected fields of a new record. It
also
' copies the conference's comments into the comment field.
frmBookingBookingBased.SetFocus ' move to subform
DoCmd.GoToRecord , , acNewRec ' make a new
record
frmBookingBookingBased!ExpectedIn = Startdate ' set startdate
frmBookingBookingBased!ExpectedOut = Enddate ' set enddate
frmBookingBookingBased!Comment = Comment ' set comment
frmBookingBookingBased!RoomID.SetFocus ' leave ready for
room
End Sub
Thanks all.
Max.