473,653 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a2k - bizarre subform bug

I've copied a form that has a number of subforms each contained in a page
within a tab control.

The name of the forms are different but i'm reusing the code. I have to
make sure that I adjust all references to make this work.

But right now I'm getting a parameter prompt each time I change subforms;

"Enter Parameter Value"
Forms!frm_Input !Category
frm_Input is the original form but this copy of the form is called
frm_InputOther. There's nothing in code that could be causing this and all
the new forms have the correct names. The parent form is based on a table
(no query) but I filter the records on opening the form.

This is driving me around the bend - any ideas on what it could possibly be?
Feb 19 '06 #1
4 1182
Deano wrote:
I've copied a form that has a number of subforms each contained in a page
within a tab control.

The name of the forms are different but i'm reusing the code. I have to
make sure that I adjust all references to make this work.

But right now I'm getting a parameter prompt each time I change subforms;

"Enter Parameter Value"
Forms!frm_Input !Category
frm_Input is the original form but this copy of the form is called
frm_InputOther. There's nothing in code that could be causing this and all
the new forms have the correct names. The parent form is based on a table
(no query) but I filter the records on opening the form.

This is driving me around the bend - any ideas on what it could possibly be?

Put the following code in a code module. See if you find it. If not,
I'd run some code to check the recordsource of the form and row source
of any combos.

Public Sub QueryHasString( )
Dim qdf As QueryDef
Dim strSQL As String
For Each qdf In CurrentDb.Query Defs
strSQL = qdf.SQL
If InStr(strSQL, "Forms!frm_Inpu t!Category") > 0 Then
MsgBox qdf.name
End If
Next qdf
MsgBox "Done"
End Sub
Feb 19 '06 #2
salad wrote:

Put the following code in a code module. See if you find it. If not,
I'd run some code to check the recordsource of the form and row source
of any combos.

Public Sub QueryHasString( )
Dim qdf As QueryDef
Dim strSQL As String
For Each qdf In CurrentDb.Query Defs
strSQL = qdf.SQL
If InStr(strSQL, "Forms!frm_Inpu t!Category") > 0 Then
MsgBox qdf.name
End If
Next qdf
MsgBox "Done"
End Sub


Salad, you're the man. Bizarre bug no more, I fixed a dodgy combo that I
missed. Phew, I really needed the help. I'll squirrel that code away
somewhere as well.

thanks
Feb 19 '06 #3
Deano wrote:
salad wrote:
Put the following code in a code module. See if you find it. If not,
I'd run some code to check the recordsource of the form and row source
of any combos.

Public Sub QueryHasString( )
Dim qdf As QueryDef
Dim strSQL As String
For Each qdf In CurrentDb.Query Defs
strSQL = qdf.SQL
If InStr(strSQL, "Forms!frm_Inpu t!Category") > 0 Then
MsgBox qdf.name
End If
Next qdf
MsgBox "Done"
End Sub

Salad, you're the man. Bizarre bug no more, I fixed a dodgy combo that I
missed. Phew, I really needed the help. I'll squirrel that code away
somewhere as well.

thanks

You're welcome.

There's some sample code in on-line help that I modified slightly but
kept the same name of EmpSQL over the years due to laziness and to
remember where I got it from. The code is handy for checking record and
rowsources in forms. I too have gotten those enter parameter messages
and I go "Oh no, where the heck is it." This makes it easier to spot.

I have another routine call for reports. You can change this to look in
reports easily enough

Public Sub FormsRowSource( )
Dim dbs As Database
Dim doc As Document
Dim frm As Form

Dim i As Integer
Dim j As Integer

Set dbs = CurrentDb
With dbs.Containers! Forms
For Each doc In .Documents
'uncomment the following IF line and the Endif if searching
'for a specific form. Keep commented if searching all forms
'If Left(doc.Name, 10) = "FormNameToSear ch" Then

DoCmd.OpenForm doc.name, acDesign, , , , acHidden

Set frm = Forms(doc.name)

If InStr(frm.Recor dSource, "WordToSear ch") > 0 Then
i = i + 1
MsgBox frm.name
Else
j = j + 1
'check the controls
EmpSQL frm
End If
Set frm = Nothing
DoCmd.Close acForm, doc.name
'Endif
Next doc
End With

MsgBox "Done " & i & " " & j
End Sub
Public Sub EmpSQL(frm As Form)
Dim ctl As Control
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
For Each ctl In frm.Controls
'check each control in the form and if combo/list box
'check the rowsource for a string. Easy to update to
'check for tag, name, and other properties. You can
'change for different types of controls; labels, command
'buttons, etc.
If ctl.ControlType = acComboBox Or _
ctl.ControlType = acListBox Then
strSQL = ctl.RowSource
If InStr(strSQL, "WordToSear ch") > 0 Then
MsgBox "Form " & frm.name & " Control " & ctl.name
End If
End If
Next ctl
End Sub

Hope you find the above useful.
Feb 20 '06 #4
salad wrote:
<snipped>

Hope you find the above useful.

Thanks Salad, if I get the time soon I'll give that a test.

Feb 20 '06 #5

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

Similar topics

4
2159
by: Alan Little | last post by:
This is very bizarre. Could someone else have a look at this? Maybe you can see something I'm overlooking. Go here: http://www.newsletters.forbes.com/enews/admin/deliver.php4 U: bugtest P: test Enter 1 for "How many files in this delivery?" and select a file to upload, in one of the listed formats. Scroll down and click "Test Email".
15
24818
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that contains the subform is named Clients. I have this code in the Add Client btn: If Forms!Clients.subformVisits!VisitDirty = True Then MsgBox "Visit subform is dirty!"
25
10219
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
1
8473
by: John Michael | last post by:
I have a form that has a subform that has a subform. The subform loads a record based on a combo lookup box in the main form. I'm trying to set a value in the subform based on a value in a subform of the subform. the main Form is called Subform is called Subform in the subform is called
4
7002
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
1
3037
by: MP | last post by:
I have a main form that has a subform which also has a subform: the main form is the first subform is the second subform is When I click on the button »AddNewSubSubRecord« (add a new record in the second subform , the code generates the message: Can't find the field »POG-03 Work Subform« reffrred to in your expression.
6
5965
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few forms in the database that will use this function, so I need to be able to tell the code which form to unlock. What I have is as follows: Public Function akeyEdit()
4
8825
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form which allows me to edit the record in the subform. What I want to happen is for subform with the new edits to be updated on the main form when I close the popup. I'm sure this is a very small bit of code in the the 'On close' event for the popup...
7
12295
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm thinking the Table will stay open otherwise ??? - Do I also need to use code to Assign the Child&Master Links, or can I just type the names into the subForms Control Property and just depend on the SourceObject to link to Table???
0
8370
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
8283
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
8811
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
8590
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...
0
7302
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...
0
4147
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
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
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
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.