By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,962 Members | 1,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,962 IT Pros & Developers. It's quick & easy.

Updating a textbox on a form

100+
P: 418
frmEchoEnter has a subform which does not get activated unless the user selects an Echo Number. cboEchoSelect displays a list of Echo Number available to select.

To add to the avaialbe Echo Number I have this


Not In List

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboEchoSelect_NotInList(NewData As String, Response As Integer)
  2.     MsgBox "Double-click this field to add a New ECHO number to the list."
  3.     Response = acDataErrContinue
  4. End Sub
On Double Click

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboEchoSelect_DblClick(Cancel As Integer)
  2. On Error GoTo Err_cboEchoSelect_DblClick
  3.  
  4.     If IsNull(Me![cboEchoSelect]) Then
  5.         Me![cboEchoSelect].Text = ""
  6.     Else
  7.                 Me![cboEchoSelect] = Null
  8.     End If
  9.     DoCmd.OpenForm "frmECHO", , , , , acDialog, "GotoNew"
  10.     Me![cboEchoSelect].Requery
  11.  
  12.  
  13. Exit_cboEchoSelect_DblClick:
  14.     Exit Sub
  15.  
  16. Err_cboEchoSelect_DblClick:
  17.     MsgBox Err.Description
  18.     Resume Exit_cboEchoSelect_DblClick
  19. End Sub
After Update
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboEchoSelect_AfterUpdate()
  2.  
  3. Me.Filter = "[ECHOID]=" & Me![cboEchoSelect]
  4.  Me.FilterOn = True
  5.      EnableControls Me, acDetail, True
  6.      sfrmAP.Enabled = True
  7.      sfrmPayroll.Enabled = True
  8.  
  9.  
  10. End Sub
Everything is working except that after I add a new Echo Number, I must exit frmEchoEnter for the new number to be available on the list. What codes do I need to solve this problem?
  • I want to double click the combo box,
  • add the new number to frmEcho,
  • close fromEcho and
  • keep adding data to frmEchoEnter.

Thanks.
Jun 18 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.