Adding a subform to an existing form
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.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
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?
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.
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?
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
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.
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.
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
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