473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 cmdNewAdjustment_Click()
Set adj = New Adjustment
DoCmd.OpenForm "frmAdjustment", windowmode:=acDialog
With ajm
If Not adj Is Nothing Then
Set .Adjustment = adj
.AddAdjustment
End If
End With
Set adj = nothing
me.cldAdjustments.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 3229
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 cmdNewAdjustment_Click()
Set adj = New Adjustment
DoCmd.OpenForm "frmAdjustment", windowmode:=acDialog
With ajm
If Not adj Is Nothing Then
Set .Adjustment = adj
.AddAdjustment
End If
End With
Set adj = nothing
me.cldAdjustments.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").Form....
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
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...
7
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...
4
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...
14
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....
2
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: ...
9
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...
2
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...
11
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
0
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...
0
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,...
0
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...

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.