How do I copy and past from (ms access) to (webBase webpage)

  • Thread starter Thread starter JohnDoe
  • Start date Start date
J

JohnDoe

Hi everyone.

I got a sort of sticky situation going on here.

I need to copy data from my ms access form (after I complete a form)
and paste this forms contents into my IE webpage, which is actually a
webBase. My dept. is now going w/ a webBase instead of ms access.
But, in one of my usual routines (which can't be converted over because
it's another dept's db) will remain an ms access db. I will be using
this db for my main form entry screen.

Once I complete this main form, I need to move onto my next form, a
webBase form. The data from my filled out ms access form needs to have
all it's contents (most fields) copied and pasted into webBase's form,
and then I complete this webBase form w/ my usual and remaining entries.

My question is, how can I accomplish this in an MS Access form through
code ?

Or, do I need to create a .dll file in Delphi or something ?

Please help, I'm on Windows NT and the webBase is based on a Sequal
Server
or something like that, and I don't have admin right, if that's going to
be a problem
with my sticky situation. And, we use Office 97.

Thanks for all your assistance guys.

-john
 
Once I complete this main form, I need to move onto my next form, a
webBase form. The data from my filled out ms access form needs to have
all it's contents (most fields) copied and pasted into webBase's form,
and then I complete this webBase form w/ my usual and remaining entries.

My question is, how can I accomplish this in an MS Access form through
code ?

Or, do I need to create a .dll file in Delphi or something ?

Please help, I'm on Windows NT and the webBase is based on a Sequal
Server
or something like that, and I don't have admin right, if that's going to
be a problem
with my sticky situation. And, we use Office 97.

If the WebBase is bound to a SQL/Server table, you should be ok.
Access can link to SQL very readily. If you connect to the SQL table,
rather than cutting and pasting, I'd strongly suggest either basing
your Form directly on the SQL table, or using an Append query to move
data from a local Access table into the SQL table. Cut and paste is
better for spreadsheets and Word documents than it is for relational
databases!
 
Thanks for responding.

The thing is, the people that have created this webBase do not want any
tampering w/ tables and sql and anything else. In fact, I don't even want
to say that I'm pasting inside it, or else they would prob have a heart
attack or something.

But, my problem is, since I don't have access to these tables and sql
anythings, it's just plain easier that I copy and paste my data that I have
already typed from an ms access form, and just paste it to the webBase
forms fields. Its just easier this way, and nobody would be breaking
the (their) webBase.
Another reason for copy and pasting from one db to another, is because
I (and others) would have to re-type everything again. Also, this is not
about maintaining "relational" syntax or anything. It's just about making
it easier for myself and others that have to re-key in everything again,
but without upsetting those peoples on the other end.

Now, I know I can set up a buton on the main ms access form (the
first db we all use) and have an event that will setFocus to a given
control (in a loop, through all controls) and have it so that it copies
that controls data.
My problem is that I can't figure it exactly HOW to do this in my form.
I seem to be getting errors about "focus" or "can't have focus" or
something like that.
My other problem is in getting the ms access db to "switch" over to
the webBase's form (webpage) and set focus to an individual field
and then past the data into that field. Remeber, I can't do any kind
of programming of this webBase. I can on navigate to it and enter
in data, and then the SUBMIT button.

I would also have to set up some kind of cicular even, where all the
controls would (each) get setfocus and copied data, and switch back
and forth to the WebBase. Unfortunately, there are about 15 or
more fields that have to be copied, and some fields have lots of
data in them.. That's why I need to figure this out and get working,
because there's still a lot of re-typing to do if I can't get this to work.
Maybe it's a macro button I need to create. I don't know yet. I'm
still trying to figure this all out - for everybody's sake.

I'm sorry if thats confusing. But, if you need any additional info,
please do let me know. I would really appreciate any help or assistance
I can get on this.

Thanks again.
-john
 
DoCmd.RunCmd acCmdCopy will copy highlighted material to the Clipboard.
Unfortunately, there's no "Access way" to paste into a particular control on
a web page that I know of. If your browser is the only other application
running, you might do SendKeys to send Alt-Tab and then Sendkeys Ctrl-V to
paste. But moving the cursor to a particular control on the web page is a
problem... if you knew where the cursor would be, then you might be able to
move to the control with Tabs, before Ctrl-V to copy. If you'd do a little
experimentation, you might discover the right combination. Or, you might
have to settle for opening the browser window, and manually moving to the
control and Ctrl-V.

I'm not sure from your posts if "WebBase" is a product of some kind or a
generic term for a database with a web user interface, but it wouldn't
matter in terms of answering this question.

Larry Linson
Microsoft Access MVP
 
Thanks for responding.

The thing is, the people that have created this webBase do not want any
tampering w/ tables and sql and anything else. In fact, I don't even want
to say that I'm pasting inside it, or else they would prob have a heart
attack or something.

But, my problem is, since I don't have access to these tables and sql
anythings, it's just plain easier that I copy and paste my data that I have
already typed from an ms access form, and just paste it to the webBase
forms fields. Its just easier this way, and nobody would be breaking
the (their) webBase.

I'm confused. It sounds like The Powers That Be either a) don't want
you to update the webbase at all (yet you are required to do so) or
b) to update the webbase by hand - with all the error risk that that
entails - rather than by entering and validating the data and then
using technology to update the table.

Where are they coming from? What rights do you have to manage the
data? If you were to mail or fax them paper copy containing your
desired new contents would they type it in for you?

Any technique which relies on copying data from multiple fields on an
Access form to multiple fields on a webpage will be very difficult and
prone to error. Neither the Access form nor the web page actually
contain any data, after all; the Access and SQL Tables contain the
data, and if correct data is to appear on the webpage, then correct
data needs to be entered into the SQL tables.

I hope they can be made to see reason, because I can't suggest any
good solutions that fit your constraints!
 
Thank Larry, for your response.

I would guess it's a "term" that is use, when they speak of "webBase". Pretty
much everything these days, is refered to as "webBased" when they create
a webpage that has the functionality of a database (though limited) Just
have a look at your tipicle order form, when you surf on e-bay or what
ever is out there that takes orders over the web. Somehow, these webpages
are attached to a sequal server or some kind of database engine. In our
company, everyone is driving towards "webBased" and doing away with
ms access. In my opinion, there are a lot of areas that should NOT be
reformated to a webBase, but are being done, at the recommnedations
of many, I say, many inexperienced programmers (at least in my company)
and I have no say in such decisons - only, I have to do as they say.

I am hoping that the web page will have links associated to each field. Those
that have the underscore as the char use to jump (using the Alt_C as an ie).
If this is the case, then all that is needed by a user is to just first Alt_C to
your
first control field, and then switch over to your ms access and setup for a
"batch mode" of copy/paste. The sendKeys command might actually be
the one.

The only problem I have w/ the doCMD you posted, is that in my version of
ms access (off 97) an error pops up about the use of newer command and
a suffix has to be i.e., off97 or something like that, if your setup is off97 or

off2000 etc. I don't quite remember the exact syntax nor the complete error,
but I could never seutp for a copy-to-clipboard using the doCMD. So, I
must be missing an element or sytax. Any added light on this would be more
then welcomed.

Question:
What is the exact syntax for a given copy to clipboard on a control (any
contral,
wether has focus or not )?
I'll try it out on my off97, on my windows 98 mechine here. If it works here,
will it work on my NT station at work ?

Thanks again, and again.
-john
 
ok, picture it like this.

You have a db that use to do two things:

You have a main db for housing aprox 62 fields in total inside
an ms access db:

One set of data is from DB1 from Dept 1 - 15 fields.

Another set of data in my main DB2 from Dept 2 - 45 fields
Dept 1 has a link to Dept 2's db of 15 fields.

Dept 2 decided that its time to move to a webBase, away from
the old ms access db. So, now it's redesigned into a webBase.
But, Dept 1 has their own ideas with their current ms access db,
and keeps their db for their own continued use, since it's their db.

Dept 2 won't link to Dept 1's db because it would contaminate (so
they say) the stability of the Sequal Server (a lot of nonense, if you
ask me) i.e., Dept 1 uses's subforms etc, but since (as I was told)
webBase cannot use these in a multi tear environ becuase of the
amount of resources required, and would drain the performance
of the webBase and basically criple it. Dept 1 has several huge
gigabytes of linked tables etc. There are also two lookup tables
that the db uses to populate a listbox full of data, which is pretty
slow already, but works. Also, Dept 1 has a few developers
that are not fluent in the things of webBase. They don't want to
admit that they aren't so good, if you know what I mean.
Please understand, there is absolutely no problems with each db.
They work fine. It's just the double work envolved that is being
looked into.

Because Dept 2 made the move to webBase, the old fields were
carried over to this new webBase, but curently, we all have to do
extra work by duplicating data entry. The one from Dept 1's db,
and then in our's, Dept 2's db. We were told that we cannot link to
Dept 1 db because of resource limitation, among other reasons.
But, because Dept 2 won't link to Dept 1's db, here is our delima.
Basically, nobody want to work anything out. And, I'm here being
whatever glue assistance that I can.

So, I'm here, searching for alternative to eliminate the duplication of
data entry, if possible, and my request for help on copy/past method
between these two different db's. It's that simple. All I need is to
figure out how to copy the data from from Dept 1's db to our new
webSpace fields. When the webBase's form is completely filled, the
user presses the SUBMIT button and the new record is created.

What we figure is this, the users will enter whatever data is needed in
Dept 1's db, and later, do a batch of copy/paste, for all the records
they created in Dept 1's db.

Gosh, I hope that made some sense. It's ben given me a real headack
since I was assigned to figure this out, and both Dept's are giving me
virtually no assistance. So, I'm basically going at it alone here, and it's
not easy.

Well, thanks again.
-john
 
I tried testing the code below on a textbox conrol and a buttonm.
In the button's event, I have the code:

DoCmd.RunCmd acCmdCopy

but it's giving me an error message:

shouldn't this copy the textbox string to the clipboard ?

Thanks,
-john
 
JohnDoe said:
I tried testing the code below on a textbox conrol and a buttonm.
In the button's event, I have the code:

DoCmd.RunCmd acCmdCopy

but it's giving me an error message:


shouldn't this copy the textbox string to the clipboard ?

You can not specifiy what the DoCmd.RunCmd acCmdCopy
statement is supposed to copy so It tries to copy whatever
Item is currently selected. Since you're executing it in
the button's Click event, it's trying to copy the button and
that's why you're getting that message.

Try setting the focus to the text box and then selecting its
contents:

With Me.thetextbox
.SetFocus
.SelStart = 0
.SelLength = Len(.Value)
End With
DoCmd.RunCmd acCmdCopy

but I have no idea how you will paste that into anything
useful.

Be aware that it is possible to copy all the values of the
bound, visible controls on a form all in one shot:

DoCmd.RunCmd acCmdSelectRecord
DoCmd.RunCmd acCmdCopy

but, again, I have no idea how you could do useful work with
all that in the clipboard.
 
Dept 2 decided that its time to move to a webBase, away from
the old ms access db. So, now it's redesigned into a webBase.
But, Dept 1 has their own ideas with their current ms access db,
and keeps their db for their own continued use, since it's their db.

Dept 2 won't link to Dept 1's db because it would contaminate (so
they say) the stability of the Sequal Server (a lot of nonense, if you
ask me)

Me too!

Suggestion: migrate the data the other way. Enter Dept 1's data into
the SQL/Server (it's pronounced sequal but spelled SQL) first;
persuade the Keepers Of the Keys that a *READ ONLY* link from Access
to SQL can't harm their precious data; and run Append queries and
Update queries from SQL to update the Access tables.

As noted elsethread, the copy and paste operation is going to be
tenuous at best. Good luck with what sounds like a very unpleasant
chore!
 
Hi,

I'm still getting that error message !!
It's driving me crazy. I'm taking your word that it's suppose
to work correctly, and copy data into the clipboard.
Here is what I'm using:

Private Sub Command3_Click()

With Me.Text4
.SetFocus
.SelStart = 0
.SelLength = Len(.Value)
End With
DoCmd.RunCmd acCmdCopy

End Sub

But it gives me the error on this line here:
Run-time error '438':
Object doesn't support this property or method.

What am I doing wrong ?????

Thanks for much help,
- john



Marshall said:
You can not specifiy what the DoCmd.RunCmd acCmdCopy
statement is supposed to copy so It tries to copy whatever
Item is currently selected. Since you're executing it in
the button's Click event, it's trying to copy the button and
that's why you're getting that message.

Try setting the focus to the text box and then selecting its
contents:

With Me.thetextbox
.SetFocus
.SelStart = 0
.SelLength = Len(.Value)
End With
DoCmd.RunCmd acCmdCopy

but I have no idea how you will paste that into anything
useful.

Be aware that it is possible to copy all the values of the
bound, visible controls on a form all in one shot:

DoCmd.RunCmd acCmdSelectRecord
DoCmd.RunCmd acCmdCopy

but, again, I have no idea how you could do useful work with
all that in the clipboard.
[/QUOTE]
 
JohnDoe said:
I'm still getting that error message !!
It's driving me crazy. I'm taking your word that it's suppose
to work correctly, and copy data into the clipboard.
Here is what I'm using:

Private Sub Command3_Click()

With Me.Text4
.SetFocus
.SelStart = 0
.SelLength = Len(.Value)
End With
DoCmd.RunCmd acCmdCopy

End Sub

But it gives me the error on this line here:

Run-time error '438':
Object doesn't support this property or method.

What am I doing wrong ?????


What are you doing wrong? You copied that line of code
exactly as I wrote it, that's what you did wrong ;-)

I stared at that for quite a while before I finally realized
that I had made a fat fingered typo. It was supposed to be:

DoCmd.RunCommand acCmdCopy

Don't forget that you can run the Clipboard Viewer to see
what actually got copied.
 
Thanks Marshall, that worked for me. I'm happy much.

But, not realizing, I have stumbled upon a serious issue here.
How do I switch BACK to my MS Acess db - wow. I forgot
about factoring that one. I just split my head why open over that one
!!!

Any takers on a technique ?

-john
 
Back
Top