473,698 Members | 2,274 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 2459
cactusdata
214 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
10040
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
2100
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
5059
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
3430
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
34062
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
1916
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
7517
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
2485
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
2774
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
1955
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
8672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
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
8892
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,...
1
6518
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
5860
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();...
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2323
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
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.