Have a subform/report show new table entries

K

Ken Curtis

Hi!
I have built a form (General Log) attached to a table (General Log Table).
There are 6 fields (AutoNumber, Date, Type of Contact, Staff Name, Content,
Followup). Information put in the form is recorded in the table and a report
(General Log Report) is generated.The form occupies the top half of the
screen.

I would like the bottom half of the screen to hold a subform/report which
holds/shows the contents of the General Log Table so that when I record is
added to the table by the form (top of screen) it appears in the
subform/report. People can then scroll through this subform/report to see ALL
of the General Log entries in the General Log Table.

I have tried multiple times to do this, and, have come close to pulling it
off, but the subform/report simply won't update the subform/report at the
bottom of the screen as I add records (although records ARE updating the
General Log Report ... which I know because I can call up the report by
clicking a button).

This is very frustrating. So: my question is: aside from my first three
wives, what am I doing wrong here?

Thanks.

Ken Curtis
 
T

tina

well, i'm not sure what you mean by subform/report. a subform is a form
embedded in another form, and a report is a report - a completely different
object from a form. assuming that you have either a subform within your data
entry mainform, or a separate form open at the same time as your data entry
form, the answer is simple: requery the form that you want to see the newly
entered record in. you can run the requery code in the data entry form's
AfterUpdate event procedure. if you're using an actual subform, the syntax
would be

Me!SubformControlName.Form.Requery

if you have a separate form open, the syntax would be

Forms("SeparateFormName").Requery

hth
 
K

Ken Curtis

Tina,
It is a subform. Here is the problem: When I enter a record in the main
form it does show up in the sub form. However, when I enter a new record in
the main form, the subform resets to show only the new entry not ALL of the
entries I have made. I want to see ALL the records, ALL the time in the
subform.
Ken Curtis
 
T

tina

okay. open your mainform in Design view. click once on the subform to select
it. in the Properties box, look at the LinkChildFields and LinkMasterFields
properties. are they blank? if not, delete whatever is in those two
properties.

you'll need to requery the subform each time you add/edit a record in the
mainform. use the code i posted before, as

Me!SubformControlName.Form.Requery

make sure you're using the name of the control in the mainform that "holds"
the subform - not the name of the subform form object as it shows in the
database window. those two names may be the same, or different.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top