Hi June7
Thank you for responding. I used the following and received error like before....
"Application-Defined or Object-Defined Error"
Code:
If Me.Parent.ctrAccount.Form.ctrTransBill.Form.IsPaid = True Then
Me.LblPayment = True
Else
Me.LblPayment = True
End If
I really dont want to send up the db as it has all my log in, passwords, and accounts info init. Just to much to get rid of.
I am not using a typical tab control on parent form. It is basically a subform control, and i use vba to switch the tabls Which are actually buttons.
Code for that is:
Code:
Option Compare Database
Option Explicit
Dim TabOffColor As Long
Private Sub CmdPayNow_Click()
If Not IsNull(Me.sfrmAccount.Form.BillID) Then
DoCmd.OpenForm "frmTransBill", , , "[BillID]=" & Me.sfrmAccount.Form.BillID
Else
MsgBox "Please Select a Record to Continue"
End If
End Sub
Sub Form_Open(Cancel As Integer)
TabOffColor = RGB(37, 189, 80)
End Sub
Sub SwitchTabs(TabName As String, FormName As String, FocusField As String)
DoCmd.Echo False
DoCmd.GoToControl "AccountName"
SetAllTabsOff
sfrmAccount.SourceObject = FormName
Me.Controls(TabName).BackColor = sfrmAccount.Form.Section(0).BackColor
Me.Controls(TabName).ForeColor = RGB(0, 0, 0)
DoCmd.GoToControl "sfrmAccount"
DoCmd.GoToControl FocusField
DoCmd.GoToRecord , , acFirst
DoCmd.Echo True
End Sub
Sub SetAllTabsOff()
CmdAccountDetail.BackColor = TabOffColor
CmdAccountDetail.ForeColor = RGB(255, 255, 255)
CmdCard.BackColor = TabOffColor
CmdCard.ForeColor = RGB(255, 255, 255)
CmdReward.BackColor = TabOffColor
CmdReward.ForeColor = RGB(255, 255, 255)
CmdProtection.BackColor = TabOffColor
CmdProtection.ForeColor = RGB(255, 255, 255)
CmdViewPayBill.BackColor = TabOffColor
CmdViewPayBill.ForeColor = RGB(255, 255, 255)
End Sub
Sub CmdAccountDetail_Click()
SwitchTabs "CmdAccountDetail", "sfrmAccountDetail", "AccountNumber"
Me.CmdPayNow.Visible = False
End Sub
Sub CmdCard_Click()
SwitchTabs "CmdCard", "sfrmCreditDebit", "cboCreditDebitType"
Me.CmdPayNow.Visible = False
End Sub
Sub CmdReward_Click()
SwitchTabs "CmdReward", "sfrmReward", "AccountName"
Me.CmdPayNow.Visible = False
End Sub
Sub CmdProtection_Click()
SwitchTabs "CmdProtection", "sfrmProtectionPlan", "cboPlanType"
Me.CmdPayNow.Visible = False
End Sub
Private Sub CmdViewPayBill_Click()
SwitchTabs "CmdViewPayBill", "sfrmTransBill", "BillType"
Me.CmdPayNow.Visible = True
End Sub
Thanks
Dave