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

OnCurrent Event

P: 27
Hi again...didn't think i'd be back so soon !.
I have a quick question regarding VBA for a Form. I have the code below in the OnCurrent event of a form i'm using but i'd also like to add another piece of code which simply requeries a combo box but i get an error saying something about an ambiguous name ?

The following code works fine

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. Me.txtLast.DefaultValue = Format(Nz(DMax("CalibrationDone", "tbl_CalibrationRecords", "EquipID = '" & Me!EquipID & "'"), Date), "\#mm\/dd\/yyyy\#")
  3.  
  4. End Sub
But when i add the code below i get the error. Would anyone know what i'm doing wrong ?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. Me.Combo52.Requery
  3.  
  4. End Sub
May 29 '20 #1

✓ answered by cactusdata

Include that code line in the existing subfunction.
Don't attempt to create yet a Form_Current() event.

Share this Question
Share on Google+
2 Replies


cactusdata
Expert 100+
P: 102
Include that code line in the existing subfunction.
Don't attempt to create yet a Form_Current() event.
May 29 '20 #2

P: 27
Thanks it's ok now. I tried that initially but it didn't work...probably something else i did that caused it. Cheers for your help
May 29 '20 #3

Post your reply

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