Ambiguous Name Detected-error On Linking Subform

Aug 23, 2006

Hello,

I have a form and subform linked by the ID field (AutoNumber) on the Form and Record ID field (Number) on the subform. I have the field size on the Record ID field set to Long Integer.

When the form is opened, a message pops up "The LinkMasterFields property setting has produced this error: 'Ambiguous name detected: Add_client_info_Click' There was a macro set up with the name Add client info. However, that macro is not being used on either of these forms. I don't understand why this message is popping up.

Any ideas? I have checked each form, each form section and each field to make sure that macro didn't somehow get assigned, and I can't find it anywhere in relation to these 2 forms.

Thanks
Stacey

View Replies


ADVERTISEMENT

Ambiguous Name Detected

Nov 2, 2007

I downloaded a sample DB that someone had posted to the site and I’m trying to modify it for my use. I thought I had everything correct but when I go to the form and try to enter any data into any field I get a popup box “The expression Before Insert you entered as the event property setting produced the following error: Ambiguous name detected: DocketNumber_BeforeUpdate. Would someone give this DB a look and tell me how to correct this problem. Thanks

View 4 Replies View Related

"Ambiguous Name Detected" - Switchboard Won't Open

Sep 27, 2005

Please help!

I've done a search of the forums, the results of which have more-or-less caused me to understand (roughly) what the problem might be and how to locate the code which is causing it. Sadly, I am a bit of a Visual Basic virgin, and I am reluctant to wade right in because if I screw up this database I'll have decimated my company's advertising and marketing strategy (mailouts!).

I was trying to make a command button on a switchboard (which I have done before, but not recently) -- and was taking a bit of a trial-and-error approach. I wanted the button to result in the previewing of a set of mailing labels (which the user would susbsequently print after reviewing). One of my first attempts resulted in the button automatically printing, so I "cut" it, and several close-but-no-cigar attempts follwed, all of which I used the "cut" command to dispose of. The last attempt I made resulted in the following message:
"The expression On Open you entered as the event property setting produced the following error: Ambiguous name detected: Bulletin_Board_labels_Click.
-The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
-There may have been an error evaluating the function, event, or macro."

I "cut" the button I had just created and thought that might fix it. It didn't. I still got the above message whenever I tried to open either this switchboard or the main switchboard. I tried closing down Access and restarting it. Same message, same problem.

Below is the code from the switchboard in question -- the last few entries are the relevant ones: anything to do with "bulletin board" is stuff I was working on. As far as I can tell there are currently no duplicate queries, reports, macros, etc, named "Bulletin Board Labels" (theres is one query named "Bulletin Board Query", and one report named "Bulletin Board Mailout labels", and that's it.)

The code for the switchboard follows...

Please help me resolve this problem?

:confused:
Jennifer
_________________________________________

Option Compare Database
Option Explicit

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim stDocName As String

stDocName = "All Art Galleries"
DoCmd.OpenReport stDocName, acPreview

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub

Private Sub Command11_Click()

End Sub

Private Sub OLEUnbound22_Click()
Dim strInput As String
strInput = "help.html"
Application.FollowHyperlink strInput, , True
End Sub

Private Sub University_Bigwigs_Click()
On Error GoTo Err_University_Bigwigs_Click

Dim stDocName As String

stDocName = "University Bigwigs Query (VP's, Deans, etc)"
DoCmd.OpenReport stDocName, acPreview

Exit_University_Bigwigs_Click:
Exit Sub

Err_University_Bigwigs_Click:
MsgBox Err.Description
Resume Exit_University_Bigwigs_Click

End Sub
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stDocName As String

stDocName = "Invitation Destination Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub
Private Sub Main_Click()
On Error GoTo Err_Main_Click


DoCmd.Close

Exit_Main_Click:
Exit Sub

Err_Main_Click:
MsgBox Err.Description
Resume Exit_Main_Click

End Sub
Private Sub Help__Click()
On Error GoTo Err_Help__Click

Dim stAppName As String

stAppName = "C:AEAC Mailing list Databasehelp.html"
Call Shell(stAppName, 1)

Exit_Help__Click:
Exit Sub

Err_Help__Click:
MsgBox Err.Description
Resume Exit_Help__Click

End Sub
Private Sub Ref_List_Click()
On Error GoTo Err_Ref_List_Click

Dim stDocName As String

stDocName = "Category/Destination/Receive"
DoCmd.OpenReport stDocName, acPreview

Exit_Ref_List_Click:
Exit Sub

Err_Ref_List_Click:
MsgBox Err.Description
Resume Exit_Ref_List_Click

End Sub
Private Sub Campus_Coverage_Click()
On Error GoTo Err_Campus_Coverage_Click

Dim stDocName As String

stDocName = "Campus Coverage Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Campus_Coverage_Click:
Exit Sub

Err_Campus_Coverage_Click:
MsgBox Err.Description
Resume Exit_Campus_Coverage_Click

End Sub
Private Sub Flyer_Report_Click()
On Error GoTo Err_Flyer_Report_Click

Dim stDocName As String

stDocName = "Flyer Destination Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Flyer_Report_Click:
Exit Sub

Err_Flyer_Report_Click:
MsgBox Err.Description
Resume Exit_Flyer_Report_Click

End Sub
Private Sub Poster_Destination_List_Click()
On Error GoTo Err_Poster_Destination_List_Click

Dim stDocName As String

stDocName = "Poster Destination Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Poster_Destination_List_Click:
Exit Sub

Err_Poster_Destination_List_Click:
MsgBox Err.Description
Resume Exit_Poster_Destination_List_Click

End Sub
Private Sub Currents_Destination_List_Click()
On Error GoTo Err_Currents_Destination_List_Click

Dim stDocName As String

stDocName = "Currents Destination Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Currents_Destination_List_Click:
Exit Sub

Err_Currents_Destination_List_Click:
MsgBox Err.Description
Resume Exit_Currents_Destination_List_Click

End Sub
Private Sub Catalogue_Destination_Click()
On Error GoTo Err_Catalogue_Destination_Click

Dim stDocName As String

stDocName = "Catalogue Destination Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Catalogue_Destination_Click:
Exit Sub

Err_Catalogue_Destination_Click:
MsgBox Err.Description
Resume Exit_Catalogue_Destination_Click

End Sub
Private Sub FlyerMultCopiesButton_Click()
On Error GoTo Err_FlyerMultCopiesButton_Click

Dim stDocName As String

stDocName = "Flyer Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview

Exit_FlyerMultCopiesButton_Click:
Exit Sub

Err_FlyerMultCopiesButton_Click:
MsgBox Err.Description
Resume Exit_FlyerMultCopiesButton_Click

End Sub
Private Sub InvitatMultCopButton_Click()
On Error GoTo Err_InvitatMultCopButton_Click

Dim stDocName As String

stDocName = "Invitation Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview

Exit_InvitatMultCopButton_Click:
Exit Sub

Err_InvitatMultCopButton_Click:
MsgBox Err.Description
Resume Exit_InvitatMultCopButton_Click

End Sub
Private Sub CampFlyMultCopButton_Click()
On Error GoTo Err_CampFlyMultCopButton_Click

Dim stDocName As String

stDocName = "Campus Flyer Multiple Copies Query"
DoCmd.OpenReport stDocName, acPreview

Exit_CampFlyMultCopButton_Click:
Exit Sub

Err_CampFlyMultCopButton_Click:
MsgBox Err.Description
Resume Exit_CampFlyMultCopButton_Click

End Sub
Private Sub PostMultCopButton_Click()
On Error GoTo Err_PostMultCopButton_Click

Dim stDocName As String

stDocName = "Poster Multiple Copies Report"
DoCmd.OpenReport stDocName, acPreview

Exit_PostMultCopButton_Click:
Exit Sub

Err_PostMultCopButton_Click:
MsgBox Err.Description
Resume Exit_PostMultCopButton_Click

End Sub
Private Sub Bulletin_Board_labels_Click()
On Error GoTo Err_Bulletin_Board_labels_Click

Dim stDocName As String

stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acNormal

Exit_Bulletin_Board_labels_Click:
Exit Sub

Err_Bulletin_Board_labels_Click:
MsgBox Err.Description
Resume Exit_Bulletin_Board_labels_Click

End Sub
Private Sub Bulletin_Board_labels_Click()
On Error GoTo Err_Bulletin_Board_labels_Click

Dim stDocName As String

stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acPreview

Exit_Bulletin_Board_labels_Click:
Exit Sub

Err_Bulletin_Board_labels_Click:
MsgBox Err.Description
Resume Exit_Bulletin_Board_labels_Click

End Sub
Private Sub Command57_Click()
On Error GoTo Err_Command57_Click


Screen.PreviousControl.SetFocus
DoCmd.FindNext

Exit_Command57_Click:
Exit Sub

Err_Command57_Click:
MsgBox Err.Description
Resume Exit_Command57_Click

End Sub
Private Sub Command58_Click()
On Error GoTo Err_Command58_Click

Dim stDocName As String

stDocName = "Bulletin Board Mailout Labels"
DoCmd.OpenReport stDocName, acPreview

Exit_Command58_Click:
Exit Sub

Err_Command58_Click:
MsgBox Err.Description
Resume Exit_Command58_Click

End Sub

View 5 Replies View Related

Subform Linking Error

Dec 20, 2005

Could someone please help me trouble shoot this error:

"The Link MasterFields property setting has produced this error:'A problem occurred while Microsoft Access was communicating with the OLE Server or Active X Control'

I get the error when I try and select an item from a drop down list in a combo box on a subform that is linked to another form. The list is coming from a separate table.

When running the subform without opening the parent form I can choose from the combo box and do not get the error.

C

View 3 Replies View Related

Frequent Error In Referring / Linking Textbox In Subform From Text Box Within Main Form

Apr 17, 2013

Go to frmInvoice, and you'll see a Net Total box (txtNetTotal) . It's control source is linked to a textbox in the subform fsubInvoiceDetails2 called txtStocktotal. It basically just pulls up all the costs associated with that InvoiceID.

The reference mechanism is as follows: =[fsubInvoiceDetails2].[Form]![txtStockTotal].Now...sometimes this works and sometimes it doesn't! Sometimes i've had to use: =forms!fsubInvoiceDetails2!txtStockTotal.

It seems to be very temperamental at times and i'm not fully confident if this can be explained.By way of note, I use express builder normally to input these statements: I go to Forms > ALL FORMS > fsubInvoiceDetails2 > txtstocktotal.

View 2 Replies View Related

Forms :: IIf Statement - No Variants Detected

Jul 15, 2013

This seems correct, but it is not working.

Code : =IIf([Results]="Negative","No Variants Detected")

View 4 Replies View Related

Microsoft Access Has Detected Corruption In This File.

Nov 22, 2004

This error message appears when trying to open an Access XP database:

"Microsoft Access has detected corruption in this file. To try to repair the
corruption first make a backup copy of the file. Then, on the Tools menu, point
to Database Utilities and click Compact and Repair Database..."

But when you try to do what it suggests, it does not work. Even if you hold down the shift key when opening it, the message appears. Anybody have any ideas?

View 4 Replies View Related

Ambiguous Outer Joins?

Jul 26, 2005

Attached is a pdf of the query window showing the relationships and table structure; (sorry for the quality) the linkage is also permanent at the relationship window. I created a form (columnar) of Rooms; loaded a subform (columnar) of the projects; and then loaded the students (tabular) as a subform on the projects subform. The data entry is flawless; tabs through each field and form to form in sequence.

After entering several rooms data I tested it at the query level by loading the three tables: rooms, projects, and students, and the permanentely established linkage with junctions came in automatically. I thought I was home free--but when I run the query, I get zero records.

When I attempt various joins, thinking this will yeild all records from the many tables and their match, I get "ambiguous outer joins" and it says to run a separate query and add it to the SQL Statement?

Thanks for any help,

Almost funtional in Ann Arbor........

Oh, and thanks Pat Hartman for the tip on linkage -- although I may have screwed it up anyway.

View 11 Replies View Related

Ambiguous Outer Joins! Please Help.

Nov 23, 2004

I'm new to the Access SQL world but I have a fairly complicated query that needs to be written for a project I'm working on. I am having trouble grasping the join concepts in access. My Query so far is:

SELECT u.user_logon_tx, ur.aff_sec_role_id, r.sec_role_ds, c.sec_cls_ds, o.sec_obj_ds, ci.aff_sec_cls_id, ci.sec_cls_item_ds, IIf(p.perm_in Is Null,0,p.perm_in) AS perm
FROM aff_sec_cls_item AS ci, aff_sec_user AS u, aff_sec_role AS r, aff_sec_user_role AS ur, aff_sec_obj AS o, aff_sec_cls AS c, aff_sec_obj_item_role_perm p,
ci LEFT OUTER JOIN p ON ci.aff_sec_cls_item_id=p.aff_sec_cls_item_id
WHERE u.aff_sec_user_id=1
And ur.aff_sec_user_id=u.aff_sec_user_id
And ur.aff_sec_role_id=r.aff_sec_role_id
And o.aff_sec_obj_id=1155
And o.aff_sec_cls_id=ci.aff_sec_cls_id
And o.aff_sec_cls_id=c.aff_sec_cls_id
And ur.aff_sec_role_id=p.aff_sec_role_id
And o.aff_sec_cls_id=p.aff_sec_cls_id
And o.aff_sec_obj_id=p.aff_sec_obj_id;


I have gotten it to work by using just the tables I'm doing the outer join on but when I add everything else I get the Ambiguous Join error. I wish I was using Oracle Thanks for the help.

View 1 Replies View Related

Ambiguous Outer Joins. What Are They? How To Work Around?

Oct 30, 2007

I have a database in which i am trying to create some forms in order to search for records. The database contains several tables. Some tables are linked using a compound key while others have a single PK. I created the search form which has different searching criteria. Once a user selects the criteria, they hit the search button (there are different buttons for each type of search) the button opens up a form to display all the data. The problem is that there are many tables to report on. I created a form with a subform. The tables associated with the main form are all being retrieved fine. however the subform doesn't seem to work. I created the subform using a query to select all the fields from the desired tables, i gave this query a criteria based on the main form so that the Id's would match. (ie. Main form ID = Firstable in subform.ID)

I got a blank sheet in the subform when i used the search. i presumed that my query was not pulling records because of the referential integrity rules. i went in and changed the relationship rules so that it would include all records from the first table and matching records from the second table. (middle option in the list when editing a relationship) I now get the following error when i try to run the query.

"The SQL statement could not be executed because it contains ambiguous outer joins. To force one of the joins to be performed first, create a separate query that performs the first join and then include that query in your SQL statement."

Could someone please tell me what this means as the help is... how shall we say it.. written in true Microsoft Fashion.

And though it tells me how to fix it, i'm not really sure what it's telling me to do. I am using Access2003 But the Database is in an access 200 file format.

Thanks.

View 3 Replies View Related

'ambiguous Outter Joins' Message And Decode

Oct 24, 2007

I'm an Oracle guy, not an access guy, so I need some help please. I have 2 questions at least.

I have this query:

SELECT tOrders.ID, tCustomers.[First Name], tCustomers.[Last Name], t_OrderDetails.Product_ID, tProducts.[Prod Desc], tProducts.Price, t_OrderDetails.Qty
FROM tYears INNER JOIN (tProducts INNER JOIN ((tMonths INNER JOIN (tCustomers INNER JOIN tOrders ON tCustomers.ID = tOrders.Customer_ID) ON tMonths.ID = tOrders.Month_ID) INNER JOIN t_OrderDetails ON (tOrders.ID = t_OrderDetails.ID) AND (tOrders.Month_ID = t_OrderDetails.Month_ID) AND (tOrders.Year_ID = t_OrderDetails.Year_ID)) ON (tProducts.ID = t_OrderDetails.Product_ID) AND (tProducts.Month_ID = t_OrderDetails.Month_ID) AND (tProducts.Year_ID = t_OrderDetails.Year_ID)) ON tYears.ID = tOrders.Year_ID
WHERE (((tYears.Year)=[Forms]![pYEAR-MONTH-rpt]![Year]) AND ((tMonths.Month)=[Forms]![pYEAR-MONTH-rpt]![Month]));

And I want every ROW in the tProducts table to show up for each record in t_OrderDetails. The Orders Table is tOrders and each detail row is in 't_OrderDetails'. I went into design view and changed the links from t_orderdetails to tproducts as follows in this screenshot:

http://www.halstedhome.com/images/temp/access_screenshot.jpg

I hope that image post works.

Anyway, in Oracle, I would just simply add (+) to each join column in tProducts but here the message states I must create a subquery and then include that query into the main query. How would I go about doing that?

Any ideas at all would be much appreciated. I'm doing a project for our church for free, and Access is all we have available to use. I've got too far now to turn back.


2nd Question is:

My ultimate goal, is to get this to work, and then to put the totals of each product in tProducts into it's own COLUMN on a report showing how much of something each customer ordered. There are only 4 to 8 products each month, so I hope to see something like:

Box of Food Special #1 Special #2 Special #3
George Jones 1 0 2 3
Dirk Smith 3 2 0 0
Tyler Jones 1 0 3 1

We need the sums to print in columns, not rows. I'm trying to get a loading manifest (for lack of better words) so the volunteers can see how much of each product the customer ordered. There will never (knock on wood) be more than 4 to 8 products ever.

Any ideas on how to do that?

Thanks for any help at all. I really appreciate it.

View 5 Replies View Related

Linking From A Subform

Mar 8, 2005

Hope someone can help me with this:

1. I have a form called F_Progress.
2. I have a form called F_Property.
3. F_Property contains a subform called F_Job.
4. F_Property is linked to F_Job by the Job ID field. Its a one to many relationship.
5. F_Job is linked to F_Progress by the Job ID field as well. One job has many months progress.

What I want to achieve:

I want a button within the subform (F_Job) which when you click on opens the related record in F_Progress where the Job ID is the same as the one in the subform.

Any suggestions very much greatly appreciated.

MZP

View 1 Replies View Related

General :: Linking Back End Error

Nov 5, 2013

Have a database with a back end that I have been working on. The database resides on a USB at the moment. I was ready to deploy and now when I try to re-link the back end tables, I repeatedly have the following error: "Your network was interrupted. To continue, close the database, and then open it again."

At first I thought this was something to do with the network, as I was moving it to a shared network drive. However, I can recreate the same issue using someone else's computer and using my USB (although it's mapped to a different drive letter). I've tried a few things, including recreating the back end by importing only the table structure, but still no luck.

View 4 Replies View Related

Linking Form And Subform

Jan 5, 2006

Firstly, apologies if any of the following seems to denote bad database design or a lack of forward planning. It does, but I've inherited it, so I'm stuck with it (for the time being).

I have a Subform (Training_Records_Sub) linked to a Form (Employee_Training). Both forms get their data from tables of the same name.
Up to now, these have been linked on the field Employee_ID. This has been working fine, as all information stored related to permanent employees, so everyone had an Employee_ID value.

Now, however, I've been informed that the system also needs to store information on temporary and contract staff, neither of whom have an Employee_ID number. In fact - for reasons I fail to understand but which I'm sure make sense to management - there is no unique indentifier stored for any of these people.

The best I can come up with is as follows:

Permanent Personnel - Can be uniquely identifed by Employee_ID and Cost_Center.

Temporary Personnel - Can be uniquely dentified by Last_Name, First_Name and Requisition_Number (this last number can apply to many people). I realise that two people of the same name COULD be hired under the same requisition number, but I've been assured that this won't be allowed.

My problem is in working out how to now link the Form and Subform.

Is there some way to use an 'If...Then..Else' statement? Even in VBA? I've sort of got an idea of what I need, but a day of playing with the code hasn't worked, so I thought I'd try posting.

Any ideas greatly appreciated.

View 1 Replies View Related

Picture Linking Subform

Nov 17, 2006

I'm having a problem with my sub forms and the sample linking image code.

Top subform is in data view and the bottom in form. Sync'd with a textbox.

notes show individual data per record as you click on them, and the picture updates the location the same.

Problem I am having is that the picture does not display even though the path is there.

View 10 Replies View Related

Linking Subform To Form

Jul 20, 2006

hey all,

i am having a problem linking my subform data to my form data on more that one fitler.

that is, i have a form that contains Last_Name and First_Name and a subform that pull a different set of info form anther table as i scroll through the main form.

on the properties of the subform i have Filter set to "Me.FilterOn="Last_Name".

BUT i need to bring in the filter on Last_Name AND First_Name because of different entries that have the same last name.

thanks
tuk

View 2 Replies View Related

Linking Two Combo-boxes Within A Subform

Mar 13, 2005

I'm creating a database to assist with the sales operations of a hat shop. I have a form for creating new orders called 'Invoice' where the order number and date is set.
Within this form is a subform called 'Invoice_Order' (Continuous layout), this form is used for assigning order items to an order number.
Within the subform there are two combo boxes which search the Stock table.

1st ComboBox- diplays hat styles (E.g- v1/v2/v3/v4...)

Problem is; different hat styles are available in different colours based on the material used. I would like the second CoboBox to display a list of colours depending on the style of hat chosen.
At present i can only get it to display a list of colours for all hat styles.

Does that make sense?
Any help would be most appreciated

View 4 Replies View Related

SUbform And Linking Primary Fields

Oct 12, 2005

At the moment i have an exisiting database that was not created by me. It consits of about 7 tables and a main table. Each table has a Primary Key that is a joining field. The Main form is built with subforms and when i enter a number in the primary key filed of the main table it enters that number in all the other primary keys in the other subforms.
i have now tried to create another subform to put into the main form but i cannot get this "link" between the primary fields to work.
can someone please help.

View 1 Replies View Related

Forms :: Linking Combobox With The Subform

Jan 30, 2015

I have a form with a combo/dropdown on the MAIN form and a child subform.I have designated a Master /Child link of ID to FGId respectively linking the combobox with the subform.

However, when a select an item from the combobox I expect to see the subform datasheet refresh accordingly. This is not happenining , even when I force a refresh call on the subform control itself....?

View 1 Replies View Related

Linking Subform Fields To Main Form

Nov 22, 2006

Hi,

I have a form linked to a subform by an activity field, Both have a UID field also. I want to store the UID from the main form in each record in the subform. How do I link the two? I've done it before but cannot remember how and have been trying now for AGES! Any help would be much appreciated :)

View 2 Replies View Related

Forms :: Linking Field From Main Form To Subform

Aug 16, 2013

I have an entry form with a field(combo box) called cboGetCode. I also have a sub form (continuous form) with number of fields, also an entry form. Now, I have added a code behind the cboGetCode AfterUpdate event to populate the result to relevant fields in the main form.

PHP Code:

Me.lngSCode = DLookup("[lngSchoolCode]", "[qrReadingFirstSchools]", "[lngSchoolCode]='" & Me.cboGetCode & "'") 

This is working very well.Now, what I would like to do is get code as shown in the cboGetCode field to my sub form lngSCode field.

View 1 Replies View Related

Linking A Subform To Another Subform

Apr 18, 2006

Hi All.

I have a from "frmMainClient" which has a subform "frmJob". They are linked using a field "accoint_no". when run the output show me the content of the "frmMainClient" and all the related jobs in the "frmJob" subform.

That fine. I now want to add another subform "frmSuppliers". I want to link the "frmSuppliers" to the "frmJob" using a field "supplierID" which is in both forms.

The end result required is the "frmMainClient" content is display along with all the records in the "frmJob" (linked) and all the records in the "frmSuppliers".

I hope I have been clear.

Can anyone point me inthe right direction to make this work.

Many thanks, keep safe and well.

Dereck

View 3 Replies View Related

(Error 3022)The Changes You.... Error In Subform

Dec 18, 2006

hi guys i was wondering if you can help me this is my code: i have a main form with this code, this form contains a subform linked by the All_PricingID

Set rst = CurrentDb.OpenRecordset("tblAll_Pricing") 'main table
' adding data to the table
rst.AddNew
' Main table
rst!All_PricingID = Me.txtPricingID 'Main table pk
rst!MainContract_ID = Me.cmbMainContract 'combo box in parent form
rst!ItemNumber = Me.txtItem 'Main form text
rst.Update

'sub Table
Set rst2 = CurrentDb.OpenRecordset("tblPricing") 'sub table
For varItem = 0 To Me.lstsubContracts.ListCount - 1 'this is a list in the main form
'--- loop through all the items in the list box and create a new row in the subform for each subcontract in the listbox lstSubcontracts.
rst2.AddNew
rst2!ID = Me.All_PricingID 'sub table foreign key
rst2!SubContractID = Me.lstsubContracts.Column(0, varItem) 'sub table
rst2.Update
Next varItem
'--- close the tables
rst.Close
rst2.Close
Set rst = Nothing
Set rst2 = Nothing


the subform appears correctly with the rows i wanted added but i need the user to be able to edit a column in the subform for the rows just created (my form is on datasheet view). but everytime i move to cursor into the subform, i can't even scroll up and down.

i keep getting an error that says :

The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. (Error 3022)


but when i check my tables tblAll_Pricing and tblPricing , everything is inserted correctly according to my recorset above, do you know why this is happening? and why i am not able to edit my subform. my subform allowsedits and additions.


help!!

View 2 Replies View Related

Forms :: Linking Form To Subform Set To Continuous Form View

Aug 22, 2014

How to populate the parent form's PK to multiple records in a child subform set to a default view continuous form?

In other words, how to auto populate the primary key to multiple records displayed the subform?

View 5 Replies View Related

Subform Error!

Jan 18, 2008

Hi all!

We have a form in our application(developed in Access 2003) with numerous tabs in it. On click of each tab a subform is displayed with relevant details.

Each of the subform is mapped to a table in turn.
When the subform is opened it shows the all the values of the table.
But when the form is opened (in Access 2007), it shows only one record in the subform.

The application works fine in MS Access 2003 showing all the records in the subform.

Suggestions please!!!!!

View 2 Replies View Related

Error When Trying To Add A Second Record To Subform

Nov 24, 2005

Hi guys,

i have a form which has a sub-form on it. each one is bound to a different table. the main form has a one to many relationship with the subform, but every time i try to add a new record to the subform i get an error say that you cant insert a duplicate foreign key.

not sure how to solve that as sql enterprise manager and access do seem to have the option to allow duplicates on the foreign key coloum.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved