How to Programmatically enter/retrieve/modify a form with a subform in an unbound

jrb_ph

New member
Local time
Today, 18:20
Joined
Apr 6, 2005
Messages
5
Pls. help!!!, the attached document is the application I want to programmatically control the data entry:

1.) Parent Form is unbounded fields, and set a record source in my table "BidTabTransaction". If I want to retrieve record, I just populate the table by querydef and sql into recordset and put all the table fields into form fields. The same thing if I want to save the record, and edit the record in the form.

2.) My problem is the child form. I set a record source in my table "BidTab Details". I set the child form to allowaddition=Yes; data entry=No;Allowdeletion=No;AllowEdits=No then it just simply display the records which is equal to Bid Tab No. because it is bounded the form fields into record source fields of "BidTabDetails" Table.

How could I retrieve a record from parent form and display the details in the child form in both unbounded form fields? (FrmBidTabTransaction & FrmBidTabDetails)

I would be grateful if someone out there attends immediately with my problem because I am in deadlock deadline to submit at least a partial running application. Thank you for your kindness...

Will be waiting. You can email me at jrb_ph@yahoo.com. God Bless!!!

Sincerely,
Rody

Ps. I created this using MS ACCESS 2003.
 

Attachments

Last edited:
Rody,

Your subform is bound to a table. Fine.

How about binding it to a query. The query looks at the PK for the main
table and uses it as its Criteria.

=Forms![YourMainForm]![YourPKField]

Then, when the records change in the Main Form, just do a:

Me.YourSubForm.Requery

or

Forms![YourMainForm]![YourSubform].Requery

Aren't unbound forms wonderful?

Wayne
 
Retrieve Data From Both Unbounded Form/Subform Fields

Dear Wayne,

Thank you for your help. Attached herewith, the error returned by the main form "FrmBidTabTransaction2" when I set the form record source to "=Forms![YourMainForm]![YourPKField]". The same error when I set it to the subform record source "FrmBidTabDetails".

What actually you mean to bind it to a query? Shall I create a query as the record source for the Subform? The Main Form was set a record source to a table. So does the subform. But the Main Form fields are all unbounded. I can retrieve the records by populating the recordset thru querydef. Meaning, even I play with all the form fields, nothing will happen to the underlying table until I save the changes or add a new record.

My problem here is that I want to retrieve the record in my main form and displays the record in the subform for editing. The subform was set the record source to the table and all the form fields are bounded to the underlying table that's why when I open the main form it just simply displays the records in the subform without searching first the primary key in the main form.

I tried to remove the record source of my main form and when I run the form, there is a parameter query window asking me the fields "Tble_BidTabNo" which is the primary key, then when I enter, it displayed all the records corresponds to the primary key.

I hope you can help me get solve the problem. Thank you for your time...

Sincerely,
Rody
 

Attachments

  • Form Error.JPG
    Form Error.JPG
    65.7 KB · Views: 195

Users who are viewing this thread

Back
Top Bottom