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

Auto populate field based on recordset and coding

P: n/a

I have a problem. I need to auto populate fields based on a value
entered in combo box. Initially, I put all the required fields in the
combo box, and hide it (set to 0",0",0", ...), then use code:
Name=cbBox.column(3) to get the value.

It works fine, but I have problem with performance. The source of the
combo box is a table from another database that keeps adding up
(currently we have around 1500 records, around 5-20 new records per
day). The form that use combo box is very slow if doing it that way. I
tried to do something else, with codes mostly, but it doesn't work.
Here's my code:

Private Sub cbJobList_AfterUpdate()

Dim strSQL As String
Dim rs As Recordset

strSQL = "SELECT * from tblJobTicket WHERE JobJacketNo = " &
Set rs = CurrentDb.OpenRecordset(strSQL) '<--gives me data type

Me.ComboNo = rs("ComboNo").Value

End Sub

Mostly it gives me datatype mismatch. If I autopopulate the fields
from the codes instead of from the combo box, would it be faster? This
code works fine on the other database, but not mine. Please help. I'm
not very familiar with coding but I'm learning (have to).

Thanks for any help/advise.

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.