B
BruceM
Is there a link (relationship) between the main form's record source and the
subform's record source? If so, are the Link Child and Link Parent
properties of the subform control (the "box" on the main form containing the
subform) set to the linking field?
I just replied with a long message but it doesn't seem to be posting.
So I am going to shorten my response in case it just takes a while.
But everything you told me to do is done and does work fine the first
time I open the Main form that this is located on. I can view my
entry just fine and it updates just fine. The problem is when I
advance the main form to the next record. That is when the subform
"add" no longer shows a blank line. It shows the last entry I made on
that particular record. The blank line only appears the first time
the database is open. The main form has its own set of records from
my new "add" form. and the new "add" information stays with the
correct record on the main form it just won't give me a blank line for
a new record everytime I move from record to record on the new form.
Thanks for taking the time to help me with this!!!
subform's record source? If so, are the Link Child and Link Parent
properties of the subform control (the "box" on the main form containing the
subform) set to the linking field?
To confirm, please confirm that the form in question:
1) Has the Data Entry property set to Yes
2) Has the Cycle Property set to All Records
3) Has Allow Additions set to Yes
If so, what happens when you press the Tab key after completing record
entry? If you keep pressing it, does it go to another record eventually?
If so, click View >> Tab Order and set the Tab Order so that using the Tab
key sends the user from one control to the other in an order that makes
sense, or according to the left-to-right arrangement of the controls on
the
form, so that the last control to receive data is the last in the list.
Start by making sure the form's Cycle property is set to All Records."Lisa" <[email protected]> wrote in messageOn Apr 28, 12:13 pm, "BruceM" <bamoob_at_yawhodotcalm.not> wrote:
On Apr 28, 10:46 am, "BruceM" <bamoob_at_yawhodotcalm.not> wrote:
Is the form open, and are you absolutely sure everything is
spelled
correctly?
On Apr 28, 6:03 am, "BruceM" <bamoob_at_yawhodotcalm.not> wrote:
What error is that?
On Apr 27, 2:29 pm, "BruceM" <bamoob_at_yawhodotcalm.not> wrote:
One thing you can do is to make a single form with its Data
Entry
property
set to Yes. This means it can by used only for adding records,
and
for
viewing records added in the current session. You can prevent
record
navigation for the most part by removing the navigation
buttons.
I
will
call this form sfrmAdd.
Copy sfrmAdd as sfrmView. Change the Default View to
Continuous,
and
Data
Entry to No. You can set Allow Additions to No to prevent
using
this
form
to add new records, and to avoid the blank row that normally
appears
on
a
continuous form. Set Allow Edits and Allow Deletions as needed
for
your
situation. Make it tall enough to show several records.
Add sfrmAdd as a subform, and sfrmView as another subform just
below
it.
I
will call the subform controls (the "boxes" in which the
subforms
are
contained on the form) fsubAdd and fsubView. You can size the
subforms
so
they look like one continuous form, particularly if neither
has
a
border.
sfrmAdd can have the table as its Record Source. sfrmAdd can
have
a
query
based on the table as its Record Source, sorted as you would
like.
In
the
After Update event of sfrmAdd:
Forms!MainFormName!fsubView.Form.Requery
When I have done this I have the users tab out of the last
field
to go
to
a
new record, but you could use a command button if you prefer.
In
any
case,
requery in the After Update event as described. The just-added
item in
sfrmAdd will show up in the continuous form.
On Apr 27, 12:41 pm, "BruceM" <bamoob_at_yawhodotcalm.not>
wrote:
They should not be entering data directly into a table.
That's
what
forms
are for. In a table there is no way to do what you seek. In
a
form
there
are a number of options, including seeing just one record at
a
time.
Is it possible to have the first row of a table show the
"blank
record
line" instead of the first record. That way when people
enter
into
that table they don't have to scroll down to the end to
insert
a
new
entry into the table.- Hide quoted text -
- Show quoted text -
Sorry I wasn't clear. That table is a subform on a form. So
when
they open the form and find that table to enter data into I
want
the
first line blank so they don't have to scroll to the bottom.
Otherwise, there are daily entries they have to scroll through
to
get
to the bottom of the table. W- Hide quoted text -
- Show quoted text -
Great suggestion Bruce. There are so many tricks to learn in
Access.
I followed every step and the only problem I have is the after
update
event. Here is the code and it does not work. The
frm_NewPatientEntry is the main form where the
fsub_nursedatesview
is
located. Is this correct? Did I miss something? When I make an
entry now I get an error after I tab out of the field.
Forms!frm_NewPatientEntry!fsub_nursedatesview.Form.Requery- Hide
quoted
text -
- Show quoted text -
It says it can't find the form name.- Hide quoted text -
- Show quoted text -
Yes. The main form I am using has both subforms on it. The
dataeentry form and the view form. The main form is called frm
NewPatientEntry. There is no underscore in the actual name but I had
to add it in the code. I even changed the name of the main form to
the data entry form thinking I was supposed to use that form and I
get
the same error. It can't find the form name. Any ideas?
If there is no underscore in the actual name but there is an
underscore
in
the code then the names are not exactly the same, and the code
cannot
work.
You need to rename the form, or you can enclose the *actual* form
name
in
square brackets, which is necessary when any name contains anything
other
than letters, numbers, and underscores:
Forms![frm NewPatientEntry]![fsub nursedatesview].Form.Requery
It is best to avoid anything other than letters, numbers, and
underscores in
any names.- Hide quoted text -
- Show quoted text -
Thank you so much. That fixed it. It looks great. The only other
problem I see is that on my main form when I go from one record to the
next the data entry form to add into does not remain blank. It shows
all the entries made into it. It only shows blank the first time I
open the data base. If we tab off after adding a record a blank line
does appear as it should. But if I advance to the next record my data
entry form does not remain blank.- Hide quoted text -
- Show quoted text -I figured out what I did. I must have taken it off single form. So
now I only see the one record added. However, when I tab off the
field like you mentioned it doesnt go to a new record. How do I make
that happen?- Hide quoted text -- Show quoted text -
I tried that and its not working.- Hide quoted text -
- Show quoted text -
I just replied with a long message but it doesn't seem to be posting.
So I am going to shorten my response in case it just takes a while.
But everything you told me to do is done and does work fine the first
time I open the Main form that this is located on. I can view my
entry just fine and it updates just fine. The problem is when I
advance the main form to the next record. That is when the subform
"add" no longer shows a blank line. It shows the last entry I made on
that particular record. The blank line only appears the first time
the database is open. The main form has its own set of records from
my new "add" form. and the new "add" information stays with the
correct record on the main form it just won't give me a blank line for
a new record everytime I move from record to record on the new form.
Thanks for taking the time to help me with this!!!