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

Not in list

100+
P: 116
I have managed to write a new code into my table tbl_e_workcode and this now appears in the dropdown.

However I wish to also add a description which will also write to the "description" field in tbl_e_workcode and i am unsure how to do this.
thank you


Expand|Select|Wrap|Line Numbers
  1.  Private Sub workcode_eng_NotInList(NewData As String, Response As Integer)
  2. Dim mybase As Database, myset As Recordset
  3. Dim ctl As Control
  4.  
  5. 'return control object that points to combo box
  6. Set ctl = Me!workcode_eng
  7.  
  8. If MsgBox("Add new workcode?", _
  9.  vbOKCancel) = vbOK Then
  10. Response = acDataErrAdded
  11.  
  12. Set mybase = CurrentDb()
  13. Set myset = mybase.OpenRecordset("tbl_e_workcode", dbOpenTable)
  14.  
  15. myset.AddNew
  16. myset![e_workcode] = workcode_eng.Text
  17.  
  18. myset.Update
  19. myset.Close
  20. mybase.Close
  21. Me.workcode_eng.Dropdown
  22.  
  23. Else
  24.  
  25. Response = acDataErrContinue
  26. ctl.Undo
  27.  
  28. End If
  29.  
  30.  
  31.  
  32. End Sub
  33.  
May 29 '10 #1
Share this Question
Share on Google+
1 Reply


100+
P: 116
Hi. after sourcing the net I have found the solution.

Thanks
May 30 '10 #2

Post your reply

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