473,651 Members | 3,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subform Linking problem

52 New Member
Hi

I'm having problems with a subform, I'm using access 2007 but the DB's format is 2003, running os Xp.

This is the problem, I have a main form which is set to be a single form and will auto open to Add New Record in this form I have placed a subform which is to show continuous records for the same department (I have cleared the master and child links and get the record set via code). On the sub form I have set a few buttons which will call different sets of SQL for the subforms recordset. 2 days ago this worked perfectly, today it has just stopped and will only show fields which have the same ID as the current record in the main form. the subform, When opened on it's own still works.
I have checked for the linked fields and they are still cleared, I have commented out all of my VBA on the main form, I have compacted and repaired the db and delected the subform and replace it on the page physically clearing the linked fields and it still does not work as it did 2 days ago.

I would be happy to believe that this is a simple error but at present I believe it to be the work of malicious spirits unknown.

Any help would be great, even a direction.

Any more info or detail please ask i am more than willing.
Feb 23 '09 #1
10 1886
ChipR
1,287 Recognized Expert Top Contributor
Sometimes I get inexplicable behavior from my database, and a decompile will fix it. This set of steps may help: Recovering from Corruption
Feb 23 '09 #2
Chinde
52 New Member
Thanks for that, i've run all of the items in the article but still it is broken.

Any more anyone.
Feb 23 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
You said you are using code to get the recordset for the subform, but then you said you commented out the code. What is setting the recordset now?
Feb 23 '09 #4
Chinde
52 New Member
commented out all of the code for the main form, which on load set the general record set on the subform, but the subform has a few buttons which reference some SQL to set the recordset for it ad hoc and like I said when the subform is open independent of the main form all works just fine.

Does this make sense??
Feb 23 '09 #5
ChipR
1,287 Recognized Expert Top Contributor
So the form is supposed to filter on Department but it's filtering on some ID?
Feb 23 '09 #6
Chinde
52 New Member
Yes That's it but the linked fields properties of the subform I have emptied, so I can set the link dynamically at a later point, at present I have limited the record set in SQL to emulate the link I want. It might be worth me mentioning that the fields on the subform are more or less the same as the fields on the mainform and i've just noticed that I do have some naming conflicts (which I will sort out) but this shouldn't cause problems for the link, should it??
Feb 23 '09 #7
ChipR
1,287 Recognized Expert Top Contributor
Just the confusion of the naming conflicts could cause you problems anywhere, so hopefully straightening those out will reveal something.

The subform's LinkMasterField s and LinkChildFields can only be set in Design View or during the form's Open event, according to the Developer Reference. If you want to filter the records on different fields according to events, you can just change the filter for the subform, or change the recordset itself. If necessary, we can take a look at the code that isn't working to do that.
Feb 23 '09 #8
Chinde
52 New Member
Thanks for your help but I think I'm going to have to strip the whole thing down and see if I sort it out that way, thank fully the DB is still in early development, just hit an early stumbling block.

Thanks again
Feb 23 '09 #9
Chinde
52 New Member
Thanks for the help ChipR, I've done some work on the MainForm and SubForm and in the process placed a button on the main form which just cleared the LinkData and the FilterData to make sure that they were clear, and i found that running the SQL followed by the ClearData code that all of the correct result turned up.

Going to migrate the buttons on the SubForm to the MainForm and see if that is the long term solution.

Thanks Again
Feb 23 '09 #10

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

Similar topics

4
1862
by: tlaker10 | last post by:
Access 2000- my form has fields for “name”, “arrival”, “departure” and “site nbr”. Can I make a subform under “name” that keeps a history of all previous entries to arrival/departure/site nbr so that when the main form is changed, the new information is ADDED to the subform? Thanks *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
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
2148
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a subform. so you pick a name (in the combo box in the main form) then it should bring up all the dates for which the person has a record for (in the list box or combo box) and then once you pick a date it should bring up the specific record you want...
2
5780
by: brenda.stow | last post by:
error msg " An error occured while referencing the object. You tried to run a visual basic procedure that improperly references a property or method of an object" This msg occurs everytime I add a new record to a subform. If I close msgbox I can then successfully add new record. Have looked on MS Technet and tried their 2 suggestions:- 1)LinkChildFields property contains the name of a form property - this isn't the case linkChildFields...
2
2240
by: John | last post by:
I have two tables in a 1:M relationship- the parent has 5 fields in the primary key and the child 6 (these are actually pretty far downstream in a complicated ER model, but the problem is between these two). I set up the relationship with no problem- referential integrity and left outer join. I have created two forms- one for the parent and one for the child table. I want to import the child table's form as a subform on the parent...
4
3911
by: bobg.rjservices | last post by:
running access 2k; adp w/ linked tables to SQL server; I am absolutely stymied, and ticked off beyond belief - I can not believe how much time I've wasted trying to do something that should be comically easy!!!!! I have 2 tables: T_people, T_calls in a 1 to many relation (many calls to each person). I have a form with tabs in it. the form is NOT attached to a record
9
9682
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
0
1743
by: Mary | last post by:
I have a main form with one subform that is used to record test scores. The main form has the following fields: WratStudentID ( a combo box with 2 fields - student id and student name - . Stores the id) WratGradeLevel WratDateAdmin (mm/dd/yyyy) WratForm
8
23782
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Form is: Forms!FormName..RowSource = "TableOrQueryName"
3
2976
by: z.ghulam | last post by:
Hi, I have a PROBLEM form with a TASK table embedded as a subform. Each problem can have many tasks. What I'm trying to do is when I double-click on the task ID, the TASK form opens up on that specific task. Any help would be greatly appreciated. Cheers
0
8277
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
8803
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...
1
8465
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
8581
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
7298
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
5612
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
4144
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
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
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.