473,915 Members | 3,104 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OnCurrent Event

27 New Member
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
2 2473
cactusdata
215 Recognized Expert New Member
Include that code line in the existing subfunction.
Don't attempt to create yet a Form_Current() event.
May 29 '20 #2
Pol53
27 New Member
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

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

Similar topics

2
10054
by: Danny | last post by:
I have a checkbox that looks at the current records fields and is either checked or not based on some of these feilds. But I need to do this each time the user moves to another record, or when the cdurrent record has been changed. where would I put this code? Thanks
3
2108
by: Tim Marshall | last post by:
In A2003, I have a bound continuous form (OK, actually a sub form of an unbound main form, but I don't think that matters here). The record source consists of an Jet SQL statement that returns one record per the entity that I want to display on the form. There is another table, not included with the form's SQL source that has a one to many relationship with the table in the form's SQL statement that gives additional information about one...
1
5067
by: Diana | last post by:
I've got a database that has been working successfully for a number of years now. I just added a new item - basically a field that becomes visible depending on another field's value. When I was testing this, I noticed that the OnCurrent event wasn't firing. I went to an older version of the program and saw that it wasn't firing there either. I don't know how long this has been going on, but it's quite distressing. To test the firing, I...
2
3443
by: Rational Repairs | last post by:
I have run into a sudden problem and thought I'd see if anyone else has ran into this. Out of nowhere (sort-of) I am not able to access the OnCurrent event on a subform. I, of course, can write code for the event, but under OnCurrent does not show up on the properties of the subform, and the event does not fire. When this problem happened, it seems to have also generated an error while changing records in the Main Form. The error is...
10
34084
by: john | last post by:
In a form, when you arrive in a new record, what event is trigerred and in which object? I can't find such an event. I need to reset a value when the user arrives in a next record. Thanks, john
2
1924
by: Salad | last post by:
This was an interesting problem. I open a form, CalledForm. When a record is presented in CalledForm I needed to check the status of something. If the status is met, I needed to present DialogForm prior to allowing access to the record in CalledForm. So in the OnCurrent event of CalledForm I had If Status Then Docmd.Openform "DialogForm",,,,,acDialog Worked fine. Later, I was asked to provide a command button in DialogForm that...
5
7532
by: TomK | last post by:
I would like to use the oncurrent event of a subform. The subform class seems to offer onEnter and onExit only, so I tried up to set the event handling routine programatically. It works fine with a macro: MySubForm.Form.OnCurrent = "MyMacro" But what about using VBA code? What procedure name does Access expect after having found MySubForm.Form.OnCurrent = "" ? MySubForm.Form.Name is "myQuery" so I tried up to define
4
2493
by: Sandra Walsh | last post by:
I have a main form called f_MainTripForm_Admin with a split view. The main form has fields relating to a trip. The main form has 2 sub forms. The subforms have fields related to activities that occured on a trip, eg meetings. One trip can have many meetings assoicated with it: SubForm 1 - f_ActivityDetails_SFC: Form with tab control view of activity-related fields for one Activity SubForm 2 - f_ActivityDetails_Datasheet: datasheet view...
4
2783
Seth Schrock
by: Seth Schrock | last post by:
I have a form that has a combo box in the header that I use to navigate through the records in the form. This combo box uses the DoCmd.SearchForRecord method to go to the selected record. If I select either the second or third record (there are only three records right now), the form's OnCurrent event fires like I would expect it to. However, if I select the first record (first in the table, the form's recordset, and the combo box) the form's...
4
1962
by: MrYoda1 | last post by:
I have a folder that contains all of the student's pictures. I have a short bit of code on the student information Form that will show the picture of the student currently being displayed on the Form. The code is in the OnCurrent event. It works perfectly--on the Form. I tried using the same code on a Report, hoping that I could print each student's picture along with their data. Everything was duplicated on the Report. For some reason it...
0
10923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7256
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5943
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3368
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.