From an earlier post

J

Jim L.

I posted this question last week but haven't gotten any replies. Maybe I did
something wrong.
I have a form with a command button that opens to the switchboard of another
database, which works fine. Is there a way to pre-select the switchboard
items of the other DB to get right to the reports so all of the work is done
when the user clicks on my command button?
If so, I have another problem. My form has a text box with a name field
formatted as "Last, First". The other DB has a form with a text box
requesting the user to enter the last name, then another one for the first
name in order to fulfill the query parameters that the report is based on.
How can I break my name field up into a last name box and a first name box,
and then have those values displayed on the form of the other DB?
I'm quite lame when it comes to coding, so simple in-depth explanations are
appreciated.
 
K

kc-mass

Hi Jim

To extract your first and last names from your LastName, FirstName textbox
use:
strLast name = Left(textbox,Instr(textbox,",")-1
strFirstname = Mid(textbox,Instr(textbox,",") +2)

Substitute your real text box name for "textbox".
Substitute your real variables for strFirstName and strLastName.

As to your initial question is there a particular report you want to run in
the other DB?

Regards

Kevin
 
J

Jim L.

Thanks. I tried extracting the names, and it seems to be working fine.
I just looked through the other database, and it seems very strange to me
how it was set up.
From the command button on my form, I get to the main switchboard of the
other DB. I click on "Search For Records", which sends me to the second
Sw/B. From there I click "Report by Name", and a form pops up with a textbox
to enter the last name, another for the first name, then I click on a "Run
Query" button which actually saves the name as the query parameters. Then a
popup window displays saying "Query Complete", click "OK". Next, I click on
a "preview Report" button from the second sw/b to see the "Training Report".
To simplify, after my button opens the other DB, I need to enter my new
"LastName" & "FirstName" textbox values onto the "Training Query" conditions
line, then save & close the query. Then I can open the "Training Report" to
show the record of the same employee displayed on my form. Can these last
two steps be automated so all of this can be done with one click of a button
 
J

Jim L.

Jim L. said:
Thanks. I tried extracting the names, and it seems to be working fine.
I just looked through the other database, and it seems very strange to me
how it was set up.
From the command button on my form, I get to the main switchboard of the
other DB. I click on "Search For Records", which sends me to the second
Sw/B. From there I click "Report by Name", and a form pops up with a textbox
to enter the last name, another for the first name, then I click on a "Run
Query" button which actually saves the name as the query parameters. Then a
popup window displays saying "Query Complete", click "OK". Next, I click on
a "preview Report" button from the second sw/b to see the "Training Report".
To simplify, after my button opens the other DB, I need to enter my new
"LastName" & "FirstName" textbox values onto the "Training Query" conditions
line, then save & close the query. Then I can open the "Training Report" to
show the record of the same employee displayed on my form. Can these last
two steps be automated so all of this can be done with one click of a button
 

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