473,396 Members | 2,004 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,396 software developers and data experts.

Subform Linking problem

52
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 1865
ChipR
1,287 Expert 1GB
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
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 Expert 1GB
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
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 Expert 1GB
So the form is supposed to filter on Department but it's filtering on some ID?
Feb 23 '09 #6
Chinde
52
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 Expert 1GB
Just the confusion of the naming conflicts could cause you problems anywhere, so hopefully straightening those out will reveal something.

The subform's LinkMasterFields 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
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
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
ChipR
1,287 Expert 1GB
Good to hear that you got it working again. Always glad to help.
Feb 23 '09 #11

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

Similar topics

4
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...
4
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...
1
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...
2
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...
2
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...
4
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...
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...
0
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...
8
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
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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...

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.