Topics Search

Adding a subform to an existing form

Adding a subform to an existing form
Views: 477
I am trying to add a subform to a form that has an Autonumber primary key. The table already has data in it.
In table view,(ie using no forms) the records are added and displayed correctly. When I use the existing form and the new subform to enter data, the auto increment number does not update on the foreign key field (Linked)on the subform. It seems to have a default value of a random number (28). I was trying to implement this on an existing form that never had a subform before.
Sponsored Links:

Similar posts...


Create a subform by using the Subform Wizard

Create a subform by using the Subform Wizard Icon
Want to add a subform to an existing form? The Subform Wizard will help you get the job done. You can use an existing form as the subform, or you can have Access create one for you. Watch this five-minute demo to learn how.

Filtering form to display a record only when there are data in the subform

Filtering form to display a record only when there are data in the subform Icon
I have a feeling I'm missing the blindingly obvious, but here goes:

I have a form with a subform that work fine together, and are used for comparing imported records (in the subform) against existing data (in the main form). However, sometimes there are nodata in the subform (ie no imported records matching an existing record), in which case I don't need to see the record in the main form at all.

In other words, I only want to see the existing records that might be affected by newly-imported data - only about 30% of the overall records.

Can I filter my main form to show only records that have one or more matches in the subform?

Subform Issue

Subform Issue Icon
To put it very simply, I have created a form with a subform. The only reason I am using a subform is because I have too many fields and I need a "scroll box" within a set of tabs. I have found no other way to do it.

This method works great except for one scenario: adding records.

I have about 15 fields that I need to display, so the 15 fields are on a subform. The form and subform both reference the same table. The form is linked to the subform on its AutoNumber.

the subform doesn't seem to be linking to the newly created record and I am getting errors when adding values.

The form I am concerned with is called "SAMPLE RECORD." You will see that if you open it, it works like I want it to, but if you click the + to add a newrecord, if you start typing data in the subform I quickly get errors when exiting.

How to alert user of data changed when adding or deleting record in SubForm?

How to alert user of data changed when adding or deleting record in SubForm? Icon
I have a MainForm containg a datasheet SubForm. I want Access to alert user when closing or leaving the record in the MainForm if there is any data change. adding or deletingrecord in datasheet SubForm is considered data change of existing MainForm record.

I applied Me.Dirty function in the Before Update in both MainForm and SubForm to trigger pop up message to alert users for any data change. However, Access does not consider adding or deleting records (rows) in the datasheet SubForm as data change. Therefore, the following codes do not apply.

Can anyone suggests how to make it work for user to be informed when they leave the MainForm if there is any record (row) in datasheet SubForm added or deleted?

assign variable to existing query as parameter and requey subform

assign variable to existing query as parameter and requey subform Icon
I have a form with a subform on it. The main form has the title and one control (group radio button box) that lets you choose between one of three centre.

The subform lists the members of each centre and the data source is an existing query with member information. The item whose paramater I want to change is the one called "centre" in my query (called "all_members")

I was wondering if there was a way using vba to pass a variable as a parameter to the existing query upon which the subform is based so that when I use me.subform.requery it requeries with the new parameter.

Also how would I clear all parameters from the query using vba so that I can also run it with paramaters as "".

I want to avoid using a drop down or combo box and base the "centre" item in the query on the form control

Color of a subform

Color of a subform Icon
I am adding a subform to a form. I am a graphic designer and all my stuff needs to look "designer-ish." I have a nice color scheme worked out in my main form. When I add a subform I seem to be constrained to the default look of the subform, that is to say, it is blue. I want all the design elements of my form to be under my control. A blue subform will not be acceptable. What can I do? I also would like to have control over the way the controls on the subform look, including scroll bars, buttons, etc.

unbound subform requery/new

unbound subform requery/new Icon
Have an unbound subform ; it is a continuous form; it is set for Data Entry in its form property.

when the main form first opens is well - the subform is blank; after the user populates some info into the subform - then I need to press a button on the main form and "refresh" the subform to a blank slate.

gotonew record just moves the record selector to the bottom new record - leaving the existing data showing.

other than closing the main form manually - and reopening - - I don't see a way to reset this subform.

Master & Child Link without subform

Master & Child Link without subform Icon
1st Is possible have Master & Child Link function without adding any subform? If yes, how?

Eg: When I selected a customer "ABC Inc" from a combolist (or many more than 1 field; eg this month,sales man A and etc), all transaction record from table tbltransaction will show me all transactions in a ~*SPLITFORM*~ according what I selected, when I adding new record in the form the table tbltransaction will automatic adding new record including selection(customer ABC Inc,sales man A and etc) I make which like how parent form and subform do between master link and child link.

I did not use subform for this because I unable to add Splitform in a subform,

I try to mimic splitform in 2 subforms(1 single form and 1 datasheet), I can synchronize between single view subform and datasheet subform, but I facing problem when I adding new record and delete record and other few small problems. as my problem is very simple so I hope I can mimic subform function in Splitform, so I do not need to write many VBA code for 2 subforms(1 single form and 1 datasheet) or maybe someone can teach me how to write the VBA code which allow me mimic splitform in 2 subform.

Subform empty when main form loaded

Subform empty when main form loaded Icon
I have a mainform which contains two subforms

The first subform contains all records from a table and loads perfectly fine when the main form is opened

The second displays a subset of the same records based - a list of records for a selected company ID, this in contrast to the first subform appears blank when the main form opens.

I can manually populate the blank subform by pressing F5, adding a refresh button (uses me.reacalc) and by making the comany ID field a combox and using an after update event that refreshes the form.

I would like the empty subform to populate using the company ID selected when the form is opened (this comes from another form).

I have tried re-calculating the form using several events such as AfterUpdate - but can not get this subform to populate

How to requery main form before opening subform.

How to requery main form before opening subform. Icon
I have a main form and a subform. The subform displays fields also visible in the main form such as 'Name'. When I click a button on the main form it opens this subform. The problem is this:

Everything works fine with existing records, but when I click a button on the main form, to open up the subform, the Name field in the subform is blank, unlike that of the main form, which has just been filled in. Both forms are linked to the same 'name' field in an underlying table.

So I suspect, filling in the 'name' field in the main form, only updates the underlying table upon closing the main form (or changing the record?). What I want it to do is to update the main table as soon as the name text box has been filled in, in the main form. I hope this is clear