R
Rick A
I've tried both application.echo and docmd.echo and my form still flashes after I make a selection from my combo box.
I want the code to go off and collect the information and then display the screen.
Here's a snippet of the code. The user selects a name from the combo box and the information is displayed. I expect the screen to snap into place and instead I'm seeing a couple of pulses (if you will). It's like it is still thinking about something after the code runs.
Any idea would be wonderful.
Private Sub cboSelectRegisteredName_AfterUpdate()
Call AfterSelectionRoutine("cboSelectRegisteredName")
End Sub
Function AfterSelectionRoutine(strControl As String) As String
' this routine executes after a dog is selected.
Application.Echo False, "thinking...."
DoCmd.Echo False
' turn the controls on for the detail section of the form,
' set focus, turn off the controls for the header section,
' enagle the cancel button and the apply button
EnableControls Me, acDetail, True
Me!lstQuickEntry.SetFocus
EnableControls Me, acHeader, False
Me!cmdCancel.Enabled = True
Me!cmdApply.Enabled = True
' finally enable the controls on the dog event subform
EnableControls fsubUniversalGenericEntryDogEvent.Form, acDetail, True
' populate the event dates listbox one time after load
' this will speed up initial load of the form.
If Me.lstEventDates.RowSource = "" Then
strSQL = "SELECT EventDateID, " & _
"IIf(DLookUp('OrganizationCD','qrySelectControlApplicationData')='CKC','#' & EventDateDescription & ' ' & Format(EventDate,'dddd'),Format(EventDate,'ddd mmm-dd-yyyy')) AS FormatedEventDate, " & _
"EventDate " & _
"FROM qrySelectEventDate; "
Me.lstEventDates.RowSource = strSQL
' also populate title list listbox based on first row of the
' event dates listbox and after the first load of the event date
strSQL = "SELECT [TitleID], [TitleEventDateID], [Title] " & _
"FROM qrytblTitleEvent WHERE EventDateID=" & Me.lstEventDates.ItemData(0)
Me.lstTitleList.RowSource = strSQL
Me.lstJumpHeight.RowSource = "qrySelectJumpHeight"
Me.lstISCJumpHeight.RowSource = "qrySelectJumpHeightISC"
Me.lstQuickEntry.RowSource = "qrySelectForQuickEntry"
Me.txtEntryFor.Visible = True
Me.txtClassesFor.Visible = True
Me.txtTitlesFor.Visible = True
End If
' position on the first row of the event dates listbox
' Me.lstEventDates = Me.lstEventDates.ItemData(0)
' Set up the dog entry listbox based on what dog was selected
strSQL = "SELECT DogID, TitleEventDateID, EventID, " & _
"Format([EventDate],'ddd dd-mmm-yyyy') AS [Event Date], " & _
"EventDateDescription as [Trial Number], TitleAbbreviated as [Title], " & _
"JumpHeightCD as [Jump Height] " & _
"FROM qrySelectDogEntry " & _
"WHERE DogID = " & Me.Controls(strControl).Value & " and " & _
"EventID = " & Me.txtEventID & " " & _
"ORDER BY EventDate, EventDateDescription, CatalogSortOrder"
Me!lstDogEntry.RowSource = strSQL
' set the record source for the form. It is the information for the
' most recently selected dog. The dog selected can be one of three options
' that's why me.control(strcontrol).value is used
Me.RecordSource = "Select * from qrySelectDog WHERE DogID = " & Me.Controls(strControl).Value
' Me.grpJumpHeight = DLookup("JumpHeightinInches", "qrySelectDogsInEventEntry", _
"DogID=" & Me.cboSelectRegisteredName)
' go get the arm band number for the selected dog.
Me!lstArmBandNumber.RowSource = BuildABNListBox(Me!DogID.Value, Me!txtEventID, Me)
' set the other selection combo boxes on the form so they all say the same dog.
Me!cboSelectRegisteredName.Value = Me.Controls(strControl)
Me!cboSelectCallName.Value = Me.Controls(strControl)
Me!cboRegistrationNumber.Value = Me.Controls(strControl)
DoCmd.Echo True
Application.Echo True, "ready"
End Function
I want the code to go off and collect the information and then display the screen.
Here's a snippet of the code. The user selects a name from the combo box and the information is displayed. I expect the screen to snap into place and instead I'm seeing a couple of pulses (if you will). It's like it is still thinking about something after the code runs.
Any idea would be wonderful.
Private Sub cboSelectRegisteredName_AfterUpdate()
Call AfterSelectionRoutine("cboSelectRegisteredName")
End Sub
Function AfterSelectionRoutine(strControl As String) As String
' this routine executes after a dog is selected.
Application.Echo False, "thinking...."
DoCmd.Echo False
' turn the controls on for the detail section of the form,
' set focus, turn off the controls for the header section,
' enagle the cancel button and the apply button
EnableControls Me, acDetail, True
Me!lstQuickEntry.SetFocus
EnableControls Me, acHeader, False
Me!cmdCancel.Enabled = True
Me!cmdApply.Enabled = True
' finally enable the controls on the dog event subform
EnableControls fsubUniversalGenericEntryDogEvent.Form, acDetail, True
' populate the event dates listbox one time after load
' this will speed up initial load of the form.
If Me.lstEventDates.RowSource = "" Then
strSQL = "SELECT EventDateID, " & _
"IIf(DLookUp('OrganizationCD','qrySelectControlApplicationData')='CKC','#' & EventDateDescription & ' ' & Format(EventDate,'dddd'),Format(EventDate,'ddd mmm-dd-yyyy')) AS FormatedEventDate, " & _
"EventDate " & _
"FROM qrySelectEventDate; "
Me.lstEventDates.RowSource = strSQL
' also populate title list listbox based on first row of the
' event dates listbox and after the first load of the event date
strSQL = "SELECT [TitleID], [TitleEventDateID], [Title] " & _
"FROM qrytblTitleEvent WHERE EventDateID=" & Me.lstEventDates.ItemData(0)
Me.lstTitleList.RowSource = strSQL
Me.lstJumpHeight.RowSource = "qrySelectJumpHeight"
Me.lstISCJumpHeight.RowSource = "qrySelectJumpHeightISC"
Me.lstQuickEntry.RowSource = "qrySelectForQuickEntry"
Me.txtEntryFor.Visible = True
Me.txtClassesFor.Visible = True
Me.txtTitlesFor.Visible = True
End If
' position on the first row of the event dates listbox
' Me.lstEventDates = Me.lstEventDates.ItemData(0)
' Set up the dog entry listbox based on what dog was selected
strSQL = "SELECT DogID, TitleEventDateID, EventID, " & _
"Format([EventDate],'ddd dd-mmm-yyyy') AS [Event Date], " & _
"EventDateDescription as [Trial Number], TitleAbbreviated as [Title], " & _
"JumpHeightCD as [Jump Height] " & _
"FROM qrySelectDogEntry " & _
"WHERE DogID = " & Me.Controls(strControl).Value & " and " & _
"EventID = " & Me.txtEventID & " " & _
"ORDER BY EventDate, EventDateDescription, CatalogSortOrder"
Me!lstDogEntry.RowSource = strSQL
' set the record source for the form. It is the information for the
' most recently selected dog. The dog selected can be one of three options
' that's why me.control(strcontrol).value is used
Me.RecordSource = "Select * from qrySelectDog WHERE DogID = " & Me.Controls(strControl).Value
' Me.grpJumpHeight = DLookup("JumpHeightinInches", "qrySelectDogsInEventEntry", _
"DogID=" & Me.cboSelectRegisteredName)
' go get the arm band number for the selected dog.
Me!lstArmBandNumber.RowSource = BuildABNListBox(Me!DogID.Value, Me!txtEventID, Me)
' set the other selection combo boxes on the form so they all say the same dog.
Me!cboSelectRegisteredName.Value = Me.Controls(strControl)
Me!cboSelectCallName.Value = Me.Controls(strControl)
Me!cboRegistrationNumber.Value = Me.Controls(strControl)
DoCmd.Echo True
Application.Echo True, "ready"
End Function