
Signature
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
> I have a form A where I have a command button that needs to open Form B.
> Form B has a subform C on it in datasheet view. I need the command button to
[quoted text clipped - 3 lines]
> new record to form B instead of form C. How do I correctly call subform C?
> Thanks!
Okay, what it's doing is writing over existing records rather than adding it
as a new record. The subform is in dataSHEET view & I need all the records
for that account to show up so the user will know whether or not they really
want to "commit" this record as it stands. They may need to "tweak" it, if
the customer has a credit balance or whatever. Somehow I have to get it to
go to a new record without it going into DataENTRY view.
Here's the code I have so far:
Dim stLinkCriteria As String, form1 As String, form2 As String
Dim form3 As String, form4 As String, qry As String
form1 = "frmAccount"
form2 = "frmTransaction"
form3 = "frmCustomer"
form4 = "frmCustomerTourDataEntry"
stLinkCriteria = "[CID]=" & Me![CID]
'Saves current record in tblCustomerTour
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Opens account form to current customer
DoCmd.OpenForm form1, , , stLinkCriteria
'DoCmd.GoToRecord , , acNewRec
Forms!frmAccount!frmTransaction.Form![TID] =
Form_frmCustomerTourDataEntry.TID
Forms!frmAccount!frmTransaction.Form![Type] = "Charge"
Forms!frmAccount!frmTransaction.Form![Charge-DR] =
Form_frmCustomerTourDataEntry.CustomerPrice
Right now the line that adds a new record is commented out because it's
opening in DATAENTRY mode, not showing all the other records that need to be
shown so that the Account BALANCE text box on the parent form contains the
correct amount (it's a calculated figure based on the entries in the
transaction subform)
Thanks in advance for your help!
> The proper syntax for addressing a subform is:
>
[quoted text clipped - 19 lines]
> C?
> > Thanks!