I have some forms that have multiple cascading combo boxes. When a user selects an item in the listbox then I fill the form. The problem is
Problem is... the screen flickers while loading, because there are so many combo boxes. I have tried hiding the fields while loading and setting the tabcontrol to another tab thinking it would take the focus off the first tab loading. I've also tried loading only the first page of the tab and then loading the rest when they click on a tab, Again, the first page holds all the main information.
I thought the maybe if I set the value and then requery in the query that would help, but no change.
This is a screen shot of one of the forms I have. There are 7 cascading combo boxes.
The way the load starts is
Each combo box has a rowsource similar to
All the combo boxes have their row source set using the query
When someone clicks on the listbox on the left the following procedure is called.
Then the following is executed
I am hoping someone has a way that I can load this information without the form flickering. Any suggestions etc. truly appreciated
Problem is... the screen flickers while loading, because there are so many combo boxes. I have tried hiding the fields while loading and setting the tabcontrol to another tab thinking it would take the focus off the first tab loading. I've also tried loading only the first page of the tab and then loading the rest when they click on a tab, Again, the first page holds all the main information.
I thought the maybe if I set the value and then requery in the query that would help, but no change.
This is a screen shot of one of the forms I have. There are 7 cascading combo boxes.
The way the load starts is
Each combo box has a rowsource similar to
Code:
SELECT tblBankTransactionTypes.BankTransTypeID,
tblBankTransactionTypes.DeductWithdrawID,
tblBankTransactionTypes.TransType, tblBankTransactionTypes.BankID
FROM tblDeductOrWithdraw INNER JOIN tblBankTransactionTypes ON
tblDeductOrWithdraw.DeductWithdrawID = tblBankTransactionTypes.DeductWithdrawID
WHERE (((tblBankTransactionTypes.DeductWithdrawID)=1) AND
((tblBankTransactionTypes.BankID)=[Forms]![frmCustomNav]![fSubForm].[Form]![cboBank]))
ORDER BY tblBankTransactionTypes.TransType;
All the combo boxes have their row source set using the query
When someone clicks on the listbox on the left the following procedure is called.
Code:
Private Sub lstSearch_Click()
Dim LBillID As Long
LBillID = Field2Long(Me.lstSearch)
Me.txtBillID = LBillID
If Not LBillID > 0 Then
LBillID = Me.txtBillID 'needs to be set because its coming from doclickonsearch procedure
End If
If LBillID > 0 Then
Me.fSubBillDueDates.Form.Requery
LaunchBillForm LBillID
Else
MsgBoxNoRecordSelected
End If
Me.txtInvoiceNumb.SetFocus
End Sub
Then the following is executed
Code:
On Error GoTo ErrorHandler
Set sFrm = ReturnCustomNavForm
If sFrm Is Nothing Then
MsgBox "No form in launchbillform"
Exit Sub
End If
sFrm.tbBills.Value = 3 'try to hide loading
Application.Echo False
s = "select * from tblBills where billid = " & LBillID & " "
Set rs = CurrentDb.OpenRecordset(s)
If Not rs.EOF Then
With rs
sFrm.txtConName = Field2String(!ConName)
sFrm.txtConEmail = Field2String(!ConEmail)
sFrm.txtConPhone = Field2String(!ConPhone)
sFrm.txtConExt = Field2String(!ConExt)
sFrm.txtBillID = LBillID
sFrm.cboPerson.Value
SetComboBoxValueLong sFrm.cboPersonID, Field2Long(!PersonID)
SetComboBoxValueLong sFrm.cboBillingPeriod, Field2Long(!BillingPeriodID)
SetComboBoxValueLong sFrm.cboPaymentTypeID, Field2Integer(!PaymentMethodID)
SetComboBoxValueLong sFrm.cboCategoryID, Field2Long(!BillCategoryID)
'sFrm.cboBillName.SetFocus
'sFrm.cboBillName.Requery
SetComboBoxValueLong sFrm.cboBillName, Field2Long(!BillNameID)
SetComboBoxValueLong sFrm.cboBank, Field2Long(!BankID)
'sFrm.cboTransType.SetFocus
'sFrm.cboTransType.Requery
'sFrm.cboAccount.SetFocus
'sFrm.cboAccount.Requery
SetComboBoxValueLong sFrm.cboTransType, Field2Long(!BankTransTypesID)
SetComboBoxValueLong sFrm.cboAccount, Field2Long(!AccountID)
SetComboBoxValueLong sFrm.cboExpenseType, Field2Long(!ExpenseTypeID)
sFrm.txtInvoiceNumb = Field2String(!InvoiceNumb)
sFrm.txtAmt = !BillAmt
sFrm.txtStartDate = !StartDate
sFrm.txtRecurDateTo = !EndDate
sFrm.txtDayToPayOn = !PayOnDay
sFrm.txtNumbOfDays = !NumbOfDays
SetComboBoxValueLong sFrm.cboDayOfWeek, Field2Long(!DayOfWeekID)
SetComboBoxValueLong sFrm.cboWeekNumberID, Field2Long(!WeekNumberID)
sFrm.txtAdd1 = !Address1
sFrm.txtAdd2 = !Address2
sFrm.txtCity = !City
sFrm.txtZip = !Zip
SetComboBoxValueLong sFrm.cboStateID, Field2Long(!StateID)
sFrm.txtMailAdd1 = !MailAdd1
sFrm.txtMailAdd2 = !MailAdd2
sFrm.txtMailCity = !MailCity
sFrm.txtMailZip = !MailZip
SetComboBoxValueLong sFrm.cboMailStateID, Field2Long(!MailStateID)
sFrm.chkAlert = !Alert
sFrm.txtAlertNumb = Nz(!AlertNumber, 0)
SetComboBoxValue sFrm.cboAlertDuration, Nz(!AlertNumber, 0)
sFrm.chkRecur = !BillRecur
If !BillRecur Then
sFrm.txtRecurDateTo.Enabled = True
End If
sFrm.txtNotes = !BillNotes
sFrm.txtBillAccountNumb = Field2String(!BillAccountNumb)
sFrm.txtBillPinNumb = Field2String(!BillPinNumb)
sFrm.txtBillPhonePass = Field2String(!BillPhonePass)
sFrm.txtBillUserName = Field2String(!BillUserName)
sFrm.txtBillPassword = Field2String(!BillPassword)
sFrm.txtBillOther = Field2String(!BillOther)
End With
End If
ExitHandler:
rs.Close
Set rs = Nothing
sFrm.tbBills.Value = 0 'set the tab back to the first tab
Application.Echo True
Exit Sub
ErrorHandler:
'Application.Echo True
clsErrorHandler.HandleError "modBills", "LaunchBillForm", True
Resume ExitHandler
I am hoping someone has a way that I can load this information without the form flickering. Any suggestions etc. truly appreciated