473,621 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subform Requery Issues - Error 2467

I have an unbound main form (one side) with a subform (many side).

The main form has a textbox control on it whose visible property is set
to false. It's controlsource property is a reference to the ID field
on the subform (so the main form can tell which record on the subform
is selected).

Three command buttons allow the user to manipulate records that are
displayed in the subform (Add, Edit, Delete). After the user executes
on of these commands, a requery is needed on the subform. My attempts
to requery the subform are met with the 2467 error.

Here's the code under the "Add" button:

Private Sub cmdNewAdjustmen t_Click()
Set adj = New Adjustment
DoCmd.OpenForm "frmAdjustment" , windowmode:=acD ialog
With ajm
If Not adj Is Nothing Then
Set .Adjustment = adj
.AddAdjustment
End If
End With
Set adj = nothing
me.cldAdjustmen ts.Form.Requery
End Sub

adj is a class I'm using as a Data Object. ajm is a class that handles
adding, etc. the adjustment to the database (not sure if any of this is
relevant). The last line of code is the one throwing the exception.

The name of the subform is correct. I've tried the alternate syntaxes
for referencing the control, with no success. Any ideas?

TIA,
Johnny

Nov 13 '05 #1
1 3249
Johnny Meredith wrote:
I have an unbound main form (one side) with a subform (many side).

The main form has a textbox control on it whose visible property is set
to false. It's controlsource property is a reference to the ID field
on the subform (so the main form can tell which record on the subform
is selected).

Three command buttons allow the user to manipulate records that are
displayed in the subform (Add, Edit, Delete). After the user executes
on of these commands, a requery is needed on the subform. My attempts
to requery the subform are met with the 2467 error.

Here's the code under the "Add" button:

Private Sub cmdNewAdjustmen t_Click()
Set adj = New Adjustment
DoCmd.OpenForm "frmAdjustment" , windowmode:=acD ialog
With ajm
If Not adj Is Nothing Then
Set .Adjustment = adj
.AddAdjustment
End If
End With
Set adj = nothing
me.cldAdjustmen ts.Form.Requery
End Sub

adj is a class I'm using as a Data Object. ajm is a class that handles
adding, etc. the adjustment to the database (not sure if any of this is
relevant). The last line of code is the one throwing the exception.

The name of the subform is correct. I've tried the alternate syntaxes
for referencing the control, with no success. Any ideas?

TIA,
Johnny


What is cldAdjustments? I usually reference subforms like
Forms!MainForm! SubForm.Form... .
or
Me("SubForm").F orm....
or
Dim strSubName As String
strSubName = "Test"
Me(strSubName). Form....
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
680
by: sixsoccer | last post by:
I have built a database with a <Mainform> and a <Subform>. My problem is twofold. 1. My subform is set as a continuos form with AllowAddiotions set to NO (ie. a list of Issues to the client on the mainform) 2. To add new issues, a button is used and a pop-up form is used to add an issue with more detail than what's available on the subform. 3. On accepting the new Issue from the pop-up the pop-up closes and you are returned to the...
7
11182
by: ChrisR | last post by:
Hi guys My app is a simple Main form with a few Subforms that are not linked, and a few pop forms. Problem is: I have a pop form with a Listbox with a list of records related to the subform in the Main form. I'd like to double click on the selected file in the listbox and load that record into the the Subform, easy
4
4563
by: mooseshoes | last post by:
All: Form A: Main_Form Form B: Sub_Form (has the control name: Sub_Form_Control_Name) Form C: Independent_Form Form C is based on a table which is also used by Form B. When Form C is used to update the table I want to requery and redisplay the data in Form B.
14
11459
by: Kurt | last post by:
I have an unbound main form with an unbound subform. frmProjects fsubProjectList Using combo boxes, the user can select several search criteria on frmProjects and then click a command button. The command button passes the criteria as a string to a query. A subform, which is based on this query, shows the results of the search.
2
4287
by: David W. Fenton | last post by:
I think at various times we've all encountered this problem: A subform is on a main form. From the code of the main form we refer to some property of/control on the child form thus: Me!subForm.Form!txtTextBox and for some reason, in certain contexts, we get the error: Error 2455: You entered an expression that has an invalid reference
9
9680
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
2
3006
by: qianiqan | last post by:
We have three forms: Main form, SearchForm and its subform SubFormS. Click the button cmdA in MainForm will open the SearchForm. The Search form has a subform SubFormS. The Access database has two version db04 and db09. In the old version db04 when I click the command cmdA, it goes first to Form_open of subformS, then goes to the form_open of the SearchForm. Everything is fine. In the new version db09 when I click the command cmdA, it...
11
7150
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my mind I am wonder if this is causing my problem, but I don’t want to go through the work to convert to DAO unless I know it is truly in my best interest.) I am having problems getting a requery to show up consistently on a couple of forms. I have...
4
2583
by: mrubel99 | last post by:
I have a subform built into a form in Access 2007. I would like the user to be able to filter the subform using their own criteria by right clicking the column header in the subform. Once the user has the subform record set filtered as they want I would like them to be able to click a button on the main form that will set the yes/no field in the filtered subfom data set to true. Here is the code I have been trying to get to work and it...
0
8213
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
8156
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8653
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
8597
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...
0
7127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6101
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
5554
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
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
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

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.