472,126 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,126 software developers and data experts.

OnCurrent Event

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.

2 2320
cactusdata
202 Expert 128KB
Include that code line in the existing subfunction.
Don't attempt to create yet a Form_Current() event.
May 29 '20 #2
Pol53
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.

Similar topics

1 post views Thread by Diana | last post: by
2 posts views Thread by Rational Repairs | last post: by
10 posts views Thread by john | last post: by
2 posts views Thread by Salad | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.