Two forms, one entry

F

FpwL1399

I posted this two places, so we'll see which one gets a response
faster.

Okay, new question for me. I would like to set up two forms that enter

data into the same row in a table. The reason for this is that in one
of our processes we have to log in and log out the same thing with
different measurements at each step. I would really enjoy it if I put
it in one table and just had the log out data added onto the log in
data. Is there a way to make the log out form look up the log in
information and continue with it? thanks for all your help in advance.
 
G

Graham R Seach

Posting to several groups, just to "see which one gets a response faster" is
VERY BAD FORM! You can cross-post, but no-one like multi-posting, because it
wastes people's time.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
J

John Vinson

I posted this two places, so we'll see which one gets a response
faster.

That's uncommonly rude.

Most of us who volunteer here cover more than one newsgroup. I saw
both your messages, as did many of the other volunteers.

You're basically saying "ok, I'll waste several people's time
answering questions in duplicate just to see who falls for it". OK,
after thinking about it for a while, I did.

If you must post in two newsgroups, please *crosspost* rather than
multiposting. See http://www.mvps.org/access/netiquette.htm.
Okay, new question for me. I would like to set up two forms that enter

data into the same row in a table. The reason for this is that in one
of our processes we have to log in and log out the same thing with
different measurements at each step. I would really enjoy it if I put
it in one table and just had the log out data added onto the log in
data. Is there a way to make the log out form look up the log in
information and continue with it? thanks for all your help in advance.

Sure. Just base both Forms on the same query on the table. How would
the log out form "look up the log in information"? What is distinctive
about the particular record which needs to be looked up, and how can
it be distinguished from other records in the table?

John W. Vinson[MVP]
 
F

FpwL1399

Well thank you two for informing me of my error. I did not try to be
rude nor did I try to waste any ones time. I had no idea there was a
way to "crosspost"; I did not know there was etiquette to posting
either. I have just recently gotten involved in this type of thing. I
am sorry if I have offended you in some way. And I am also sorry that
I wasted your valuable time. Please forgive my ignorance.

Now, back to the topic. I do have a descriptor field (run number) that
is unique to each entry. I assumed that would be how to make this
work, but I don't know how to actually do it..

Thanks for your help.
 
G

Graham R Seach

The reason you don't multipost, is that this very question was answered in
the mpa.forms. Perhaps you abandoned that thread because you didn't like the
answer you were given, or because you lost track of it altogether.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
F

Fletcher

Okay, I understand. I made a mistake by multiposting and I've
appologized for that mistake. I won't do it again. Now can I maybe
get some help with this problem I'm working on. I would like the "log
out" form to look up, based on run number, the "log in" data and add to
that. You've told me that I can do it, but I don't know how. Please
help. Thank you.
 
G

Graham R Seach

Fletcher,

I assume you're storing the run number somewhere, perhaps in a public
variable. Then all you need to do is execute a SQL UPDATE statement when the
user logs out. You need a few things.

You have a log-in form, which presumably is where you get the run number
from. After login, rather than closing this form, hide it. Create an Unload
event on this form, which executes the following code (assuming the run
number is stored in a module-level variable called varRunNo.

Private Sub Form_Unload()
Dim strSQL As String

strSQL = "UPDATE tblLogin " & _
"SET LogOut = #" & Now & "# " & _
"WHERE RunNo = " & varRunNo

DBEngine(0)(0).Execute strSQL, dbFailOnError
End Sub

Assuming the login form is still open (albeit invisible), when the user
shuts down the application, the login form unloads, firing the Unload event.
The above code sets the LogOut field with the current datetime, for the
current run number.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
F

Fletcher

I'm not very experienced with all of what you're talking about, and I'm
not sure if it would work, but I don't believe that it is what I'm
looking for. What I need to do is have two forms that go to the same
table. The log in form has 4 or 5 peices of data that it enters into
the table...one of these things is Run Number. The log out form, I
would like to look up, based on run number, the row of data that was
logged in and be able to add data to that....perhaps 5 more peices of
data. I don't know how to make this work. If there were a way to do
it without code, I would be more understanding of the explanation.

Thanks for your effort.
 
G

Graham R Seach

Fletcher,

OK, I think maybe I understand now.

As I said before, you need two forms; one to "log in", and one to "log out".
I think you're pretty OK with how to create the "log in" form. The "log out"
form just needs to be able to search for the correct run number.

1. Create the second form, and place all the relevent controls on it.
2. In design view, make sure the Control Wizards are enabled on the Toolbox,
then add a combo box to the form.
3. When the Combo Box Wizard shows up, select "Find a record on my form...",
and click Next.
4. Select Run Number in the [Available Fields] pane, and click >.
5. Click Next.
6. Click Next.
7. Click Finish.

The wizard has added code to the form, which will display the record whose
Run Number matches whatever you selected in the combo box.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
F

Fletcher

That's perfect....But does that have to be a combo box to look up the
other entries? If not, is there any way that I can code it to disclude
entries that have already been logged out?

Thanks a milion.
Graham said:
Fletcher,

OK, I think maybe I understand now.

As I said before, you need two forms; one to "log in", and one to "log out".
I think you're pretty OK with how to create the "log in" form. The "log out"
form just needs to be able to search for the correct run number.

1. Create the second form, and place all the relevent controls on it.
2. In design view, make sure the Control Wizards are enabled on the Toolbox,
then add a combo box to the form.
3. When the Combo Box Wizard shows up, select "Find a record on my form...",
and click Next.
4. Select Run Number in the [Available Fields] pane, and click >.
5. Click Next.
6. Click Next.
7. Click Finish.

The wizard has added code to the form, which will display the record whose
Run Number matches whatever you selected in the combo box.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Fletcher said:
I'm not very experienced with all of what you're talking about, and I'm
not sure if it would work, but I don't believe that it is what I'm
looking for. What I need to do is have two forms that go to the same
table. The log in form has 4 or 5 peices of data that it enters into
the table...one of these things is Run Number. The log out form, I
would like to look up, based on run number, the row of data that was
logged in and be able to add data to that....perhaps 5 more peices of
data. I don't know how to make this work. If there were a way to do
it without code, I would be more understanding of the explanation.

Thanks for your effort.
 
G

Graham R Seach

Fletcher,

No, it doesn't have to be a combo; I just opted for a combo because it
seemed the easiest. You could use a listbox if you wanted to.

If you want to exclude those record that have been logged out, just amend
the combo's RowSource property to exclude the records that have been logged
out (using a WHERE clause).

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Fletcher said:
That's perfect....But does that have to be a combo box to look up the
other entries? If not, is there any way that I can code it to disclude
entries that have already been logged out?

Thanks a milion.
Graham said:
Fletcher,

OK, I think maybe I understand now.

As I said before, you need two forms; one to "log in", and one to "log
out".
I think you're pretty OK with how to create the "log in" form. The "log
out"
form just needs to be able to search for the correct run number.

1. Create the second form, and place all the relevent controls on it.
2. In design view, make sure the Control Wizards are enabled on the
Toolbox,
then add a combo box to the form.
3. When the Combo Box Wizard shows up, select "Find a record on my
form...",
and click Next.
4. Select Run Number in the [Available Fields] pane, and click >.
5. Click Next.
6. Click Next.
7. Click Finish.

The wizard has added code to the form, which will display the record
whose
Run Number matches whatever you selected in the combo box.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Fletcher said:
I'm not very experienced with all of what you're talking about, and I'm
not sure if it would work, but I don't believe that it is what I'm
looking for. What I need to do is have two forms that go to the same
table. The log in form has 4 or 5 peices of data that it enters into
the table...one of these things is Run Number. The log out form, I
would like to look up, based on run number, the row of data that was
logged in and be able to add data to that....perhaps 5 more peices of
data. I don't know how to make this work. If there were a way to do
it without code, I would be more understanding of the explanation.

Thanks for your effort.

Graham R Seach wrote:
Fletcher,

I assume you're storing the run number somewhere, perhaps in a public
variable. Then all you need to do is execute a SQL UPDATE statement
when
the
user logs out. You need a few things.

You have a log-in form, which presumably is where you get the run
number
from. After login, rather than closing this form, hide it. Create an
Unload
event on this form, which executes the following code (assuming the
run
number is stored in a module-level variable called varRunNo.

Private Sub Form_Unload()
Dim strSQL As String

strSQL = "UPDATE tblLogin " & _
"SET LogOut = #" & Now & "# " & _
"WHERE RunNo = " & varRunNo

DBEngine(0)(0).Execute strSQL, dbFailOnError
End Sub

Assuming the login form is still open (albeit invisible), when the
user
shuts down the application, the login form unloads, firing the Unload
event.
The above code sets the LogOut field with the current datetime, for
the
current run number.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Okay, I understand. I made a mistake by multiposting and I've
appologized for that mistake. I won't do it again. Now can I maybe
get some help with this problem I'm working on. I would like the
"log
out" form to look up, based on run number, the "log in" data and add
to
that. You've told me that I can do it, but I don't know how.
Please
help. Thank you.

Graham R Seach wrote:
The reason you don't multipost, is that this very question was
answered
in
the mpa.forms. Perhaps you abandoned that thread because you didn't
like
the
answer you were given, or because you lost track of it altogether.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Well thank you two for informing me of my error. I did not try
to
be
rude nor did I try to waste any ones time. I had no idea there
was
a
way to "crosspost"; I did not know there was etiquette to posting
either. I have just recently gotten involved in this type of
thing.
I
am sorry if I have offended you in some way. And I am also sorry
that
I wasted your valuable time. Please forgive my ignorance.

Now, back to the topic. I do have a descriptor field (run
number)
that
is unique to each entry. I assumed that would be how to make
this
work, but I don't know how to actually do it..

Thanks for your help.


John Vinson wrote:
On 14 Jul 2006 15:40:51 -0700, "FpwL1399" <[email protected]>
wrote:

I posted this two places, so we'll see which one gets a
response
faster.

That's uncommonly rude.

Most of us who volunteer here cover more than one newsgroup. I
saw
both your messages, as did many of the other volunteers.

You're basically saying "ok, I'll waste several people's time
answering questions in duplicate just to see who falls for it".
OK,
after thinking about it for a while, I did.

If you must post in two newsgroups, please *crosspost* rather
than
multiposting. See http://www.mvps.org/access/netiquette.htm.

Okay, new question for me. I would like to set up two forms
that
enter

data into the same row in a table. The reason for this is that
in
one
of our processes we have to log in and log out the same thing
with
different measurements at each step. I would really enjoy it
if I
put
it in one table and just had the log out data added onto the
log
in
data. Is there a way to make the log out form look up the log
in
information and continue with it? thanks for all your help in
advance.

Sure. Just base both Forms on the same query on the table. How
would
the log out form "look up the log in information"? What is
distinctive
about the particular record which needs to be looked up, and how
can
it be distinguished from other records in the table?

John W. Vinson[MVP]
 
F

Fletcher

Well you've been very helpful, and I'm going to work on that some more
and try to figure it out. Thank you very much.
Graham said:
Fletcher,

No, it doesn't have to be a combo; I just opted for a combo because it
seemed the easiest. You could use a listbox if you wanted to.

If you want to exclude those record that have been logged out, just amend
the combo's RowSource property to exclude the records that have been logged
out (using a WHERE clause).

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Fletcher said:
That's perfect....But does that have to be a combo box to look up the
other entries? If not, is there any way that I can code it to disclude
entries that have already been logged out?

Thanks a milion.
Graham said:
Fletcher,

OK, I think maybe I understand now.

As I said before, you need two forms; one to "log in", and one to "log
out".
I think you're pretty OK with how to create the "log in" form. The "log
out"
form just needs to be able to search for the correct run number.

1. Create the second form, and place all the relevent controls on it.
2. In design view, make sure the Control Wizards are enabled on the
Toolbox,
then add a combo box to the form.
3. When the Combo Box Wizard shows up, select "Find a record on my
form...",
and click Next.
4. Select Run Number in the [Available Fields] pane, and click >.
5. Click Next.
6. Click Next.
7. Click Finish.

The wizard has added code to the form, which will display the record
whose
Run Number matches whatever you selected in the combo box.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

I'm not very experienced with all of what you're talking about, and I'm
not sure if it would work, but I don't believe that it is what I'm
looking for. What I need to do is have two forms that go to the same
table. The log in form has 4 or 5 peices of data that it enters into
the table...one of these things is Run Number. The log out form, I
would like to look up, based on run number, the row of data that was
logged in and be able to add data to that....perhaps 5 more peices of
data. I don't know how to make this work. If there were a way to do
it without code, I would be more understanding of the explanation.

Thanks for your effort.

Graham R Seach wrote:
Fletcher,

I assume you're storing the run number somewhere, perhaps in a public
variable. Then all you need to do is execute a SQL UPDATE statement
when
the
user logs out. You need a few things.

You have a log-in form, which presumably is where you get the run
number
from. After login, rather than closing this form, hide it. Create an
Unload
event on this form, which executes the following code (assuming the
run
number is stored in a module-level variable called varRunNo.

Private Sub Form_Unload()
Dim strSQL As String

strSQL = "UPDATE tblLogin " & _
"SET LogOut = #" & Now & "# " & _
"WHERE RunNo = " & varRunNo

DBEngine(0)(0).Execute strSQL, dbFailOnError
End Sub

Assuming the login form is still open (albeit invisible), when the
user
shuts down the application, the login form unloads, firing the Unload
event.
The above code sets the LogOut field with the current datetime, for
the
current run number.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Okay, I understand. I made a mistake by multiposting and I've
appologized for that mistake. I won't do it again. Now can I maybe
get some help with this problem I'm working on. I would like the
"log
out" form to look up, based on run number, the "log in" data and add
to
that. You've told me that I can do it, but I don't know how.
Please
help. Thank you.

Graham R Seach wrote:
The reason you don't multipost, is that this very question was
answered
in
the mpa.forms. Perhaps you abandoned that thread because you didn't
like
the
answer you were given, or because you lost track of it altogether.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Well thank you two for informing me of my error. I did not try
to
be
rude nor did I try to waste any ones time. I had no idea there
was
a
way to "crosspost"; I did not know there was etiquette to posting
either. I have just recently gotten involved in this type of
thing.
I
am sorry if I have offended you in some way. And I am also sorry
that
I wasted your valuable time. Please forgive my ignorance.

Now, back to the topic. I do have a descriptor field (run
number)
that
is unique to each entry. I assumed that would be how to make
this
work, but I don't know how to actually do it..

Thanks for your help.


John Vinson wrote:
On 14 Jul 2006 15:40:51 -0700, "FpwL1399" <[email protected]>
wrote:

I posted this two places, so we'll see which one gets a
response
faster.

That's uncommonly rude.

Most of us who volunteer here cover more than one newsgroup. I
saw
both your messages, as did many of the other volunteers.

You're basically saying "ok, I'll waste several people's time
answering questions in duplicate just to see who falls for it".
OK,
after thinking about it for a while, I did.

If you must post in two newsgroups, please *crosspost* rather
than
multiposting. See http://www.mvps.org/access/netiquette.htm.

Okay, new question for me. I would like to set up two forms
that
enter

data into the same row in a table. The reason for this is that
in
one
of our processes we have to log in and log out the same thing
with
different measurements at each step. I would really enjoy it
if I
put
it in one table and just had the log out data added onto the
log
in
data. Is there a way to make the log out form look up the log
in
information and continue with it? thanks for all your help in
advance.

Sure. Just base both Forms on the same query on the table. How
would
the log out form "look up the log in information"? What is
distinctive
about the particular record which needs to be looked up, and how
can
it be distinguished from other records in the table?

John W. Vinson[MVP]
 
Top