dbTalk Databases Forums  

A2K - need to automate some data entry into a form

comp.databases.ms-access comp.databases.ms-access


Discuss A2K - need to automate some data entry into a form in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
buckskin
 
Posts: n/a

Default Re: A2K - need to automate some data entry into a form - 10-14-2011 , 06:31 PM






"Jon Lewis" <jon.lewis (AT) cutthespambtinternet (DOT) com> wrote

Quote:
"I know I could manipulate the table source directly but I need to have
the
textbox afterupdate code to fire - I just need to automate entry into the
form and all will be well"

You say that the target form wouldn't be visible to the super user and I'm
deducing that you don't want to manipulate the table data directly as you
want to fire the text box AfterUpdate events one the invisible target
form?

Firstly I think I'm right in saying if you update a control in code it's
AfterUpdate doesn't fire anyway so I don't think this approach is going to
work for you.
It does. A control's Afterupdate code can be made to fire if you call the
sub in question - I've done it previously and make use of it in another
database.

Reply With Quote
  #12  
Old   
Access Developer
 
Posts: n/a

Default Re: A2K - need to automate some data entry into a form - 10-14-2011 , 10:04 PM






"buckskin" <buckskin (AT) mailinator (DOT) com> wrote

Quote:
Basically all I'm fundamentally asking for is
how to move down a row and enter a figure.
That's it. This is nothing to do with calculated fields
or, and I have no idea where this one came from,
"usings a field in a table for temporary storage". At
no point did I say that.
No, you didn't say it -- you described it. A control on the Form that is
bound to a Field in the Table is entered by one user, but automatically
recalculated for another (and when that is done, will be automatically
stored in the Table, overriding what the first user entered). If it were
not, then it would not appear in the Report -- Reports do not 'get their
data from Forms' but from a Record Source which is a Table, Query, or
Recordset.

Quote:
BTW is there something wrong with sharing
this knowledge? Am I only allowed to know
something as long as I'm not going to offend
the Access Gods?
People here are advising you, as best they can from what you've described,
but you have a 'way to do it' in mind and reject suggestions that will
work... perhaps that's because you haven't explained what the AfterUpdate
code does and why you need to do that in that particular manner. The
AfterUpdate event does not fire, nor can you make it fire, when you set the
value of the Control from code, but YES, of course, you can call the
procedure and execute the same code. This has nothing to do with "not
offending Access Gods" but just trying to understand what it really is that
you want to do, and offering suggestions to accomplish it.

Quote:
And you say "it's not clear, just what nor why
you are storing data". Come on Larry, after
all my explanations I can only believe you're starting to
troll me.
I've answered tens of thousands of questions in Access newsgroups and have
no interest in "trolling" anyone. And, I just told you something that "all
your explanations" did not include, that appears to be important to what you
want to accomplish -- that is, whatever is done in the AfterUpdate event
code.

Quote:
As I've repeatedly said this is an alternate user
scenario. If you don't want to help that's fine but
please put aside the judgemental tone. I've
seen threads here (entertaining ones mind) where
people are ranting and raving at each other about
how something "should" be done in Access. I'm
not interested in that level of discussion.
It's not my intent to try to engage you in a philosophical discussion on how
things should or should not be done, but you should understand that there
are good reasons for valid relational database design principles.

I hope that your explanations are adequate for someone to help you... my
guess is that Jon has given you the basis (perhaps with additional code in
lieu of the AfterUpdate event code), or perhaps my suggestion of basing
"SuperUsers" Report on a Query, but without your telling us WHAT you expect
to do by executing the AfterUpdate code, it's not really possible for any of
us to say.

I apologize for the irritation that I've caused, which was not my intent.
But, as my feeble attempts to assist do appear to irritate you, I suppose I
should leave further responses to someone else who doesn't 'rub you the
wrong way'.

Larry Linson, Microsoft Office Access MVP

Reply With Quote
  #13  
Old   
buckskin
 
Posts: n/a

Default Re: A2K - need to automate some data entry into a form - 10-15-2011 , 11:33 AM



"Access Developer" <accdevel (AT) gmail (DOT) com> wrote

Quote:
"buckskin" <buckskin (AT) mailinator (DOT) com> wrote

Basically all I'm fundamentally asking for is
how to move down a row and enter a figure.
That's it. This is nothing to do with calculated fields
or, and I have no idea where this one came from,
"usings a field in a table for temporary storage". At
no point did I say that.

No, you didn't say it -- you described it. A control on the Form that is
bound to a Field in the Table is entered by one user, but automatically
recalculated for another (and when that is done, will be automatically
stored in the Table, overriding what the first user entered). If it were
not, then it would not appear in the Report -- Reports do not 'get their
data from Forms' but from a Record Source which is a Table, Query, or
Recordset.
I have no idea what you're talking about now. I think you're determinedly
holding onto the wrong end of a stick and refusing to let go. My data
structures are not in question here. They really are not. The report
source is based on a table not a form and always has been.

Quote:
BTW is there something wrong with sharing
this knowledge? Am I only allowed to know
something as long as I'm not going to offend
the Access Gods?

People here are advising you, as best they can from what you've described,
but you have a 'way to do it' in mind and reject suggestions that will
work... perhaps that's because you haven't explained what the AfterUpdate
code does and why you need to do that in that particular manner. The
AfterUpdate event does not fire, nor can you make it fire, when you set
the
value of the Control from code, but YES, of course, you can call the
procedure and execute the same code. This has nothing to do with "not
offending Access Gods" but just trying to understand what it really is
that
you want to do, and offering suggestions to accomplish it.
I am not rejecting suggestions that might work. But I don't need to keep
repeating myself and changing the terms of the original request just because
you demand it Larry. I have merely asked how to do something. That does
not make me capricious or close-minded.


Quote:
And you say "it's not clear, just what nor why
you are storing data". Come on Larry, after
all my explanations I can only believe you're starting to
troll me.

I've answered tens of thousands of questions in Access newsgroups and have
no interest in "trolling" anyone. And, I just told you something that "all
your explanations" did not include, that appears to be important to what
you
want to accomplish -- that is, whatever is done in the AfterUpdate event
code.
Well up to now you're contributed nothing Larry.


Quote:
As I've repeatedly said this is an alternate user
scenario. If you don't want to help that's fine but
please put aside the judgemental tone. I've
seen threads here (entertaining ones mind) where
people are ranting and raving at each other about
how something "should" be done in Access. I'm
not interested in that level of discussion.

It's not my intent to try to engage you in a philosophical discussion on
how
things should or should not be done, but you should understand that there
are good reasons for valid relational database design principles.
This is not about database design. Clearly you are a master of that and I
bow to your Access skills among the many other experts who have helped me
out here over the years but please don't keep turning this discussion into
something it was not.

Quote:
I hope that your explanations are adequate for someone to help you... my
guess is that Jon has given you the basis (perhaps with additional code in
lieu of the AfterUpdate event code), or perhaps my suggestion of basing
"SuperUsers" Report on a Query, but without your telling us WHAT you
expect
to do by executing the AfterUpdate code, it's not really possible for any
of
us to say.
I have acknowledged Jon's contribution. What if my afterupdate code merely
pops up a msgbox saying "Hello?". Any ramifications there are down to me
and i could always post separately. My question, if it's possible to get
back to that, is merely how to automate a form, moving down one row at a
time and entering a value. The reason for doing that is, yes, i want the
afterupdate event to fire and that was my initial focus.

If I had got a reply saying how to do that it would progress me along my
learning curve and I could see what affect it had. I really did not want
anyone to go so far beyond that focus if only because I don't wish to unduly
occupy the time of others.

Quote:
I apologize for the irritation that I've caused, which was not my intent.
But, as my feeble attempts to assist do appear to irritate you, I suppose
I
should leave further responses to someone else who doesn't 'rub you the
wrong way'.
If you stayed within the bounds of the question instead of expanding the
scope to things that simply don't matter I would not have been irritated.
I explained the information I was after quite clearly and did not think it
would encourage someone of your enormous intellect to frown and pour scorn
on my simple request.

Reply With Quote
  #14  
Old   
Jon Lewis
 
Posts: n/a

Default Re: A2K - need to automate some data entry into a form - 10-17-2011 , 04:12 AM



That's not the same as an event firing though now is it?





"buckskin" <buckskin (AT) mailinator (DOT) com> wrote

Quote:
"Jon Lewis" <jon.lewis (AT) cutthespambtinternet (DOT) com> wrote in message
news:g8adnarxf5N7hwrTnZ2dnUVZ7omdnZ2d (AT) bt (DOT) com...
"I know I could manipulate the table source directly but I need to have
the
textbox afterupdate code to fire - I just need to automate entry into the
form and all will be well"

You say that the target form wouldn't be visible to the super user and
I'm
deducing that you don't want to manipulate the table data directly as you
want to fire the text box AfterUpdate events one the invisible target
form?

Firstly I think I'm right in saying if you update a control in code it's
AfterUpdate doesn't fire anyway so I don't think this approach is going
to
work for you.

It does. A control's Afterupdate code can be made to fire if you call the
sub in question - I've done it previously and make use of it in another
database.



Reply With Quote
  #15  
Old   
Access Developer
 
Posts: n/a

Default Re: A2K - need to automate some data entry into a form - 10-17-2011 , 11:59 PM



"buckskin" <buckskin (AT) mailinator (DOT) com> wrote

Quote:
... I have merely asked how to do something.
That does not make me capricious or close-minded.
I certainly have not called you either of those names and I wish you the
best of luck to you in finding someone who can provide an answer that is
acceptable to you.

Larry Linson, Microsoft Office Access MVP

Reply With Quote
  #16  
Old   
Bob Barrows
 
Posts: n/a

Default Re: A2K - need to automate some data entry into a form - 10-18-2011 , 06:59 AM



buckskin wrote:
Quote:
This is basically a macro I guess but I'm so rusty I can't quite
think how to start.

When my form opens focus is set to a textbox in the first row within a
subform.

I just want to calculate the difference between two other columns
(also displayed on the subform) and then have that figure be
automatically entered. This will be the same as if a person was
entering the data (the afterupdate code would then run which is
important).

Then I want the return key to be pressed so that the focus shifts to
the textbox in the next row. Then repeat til we hit the bottom and
trap that error.

Ultimately I want to set this in motion from a command button and the
form will be opened and then shut invisibly.

The reason for the automation is to quickly fill out these figures
when we're in a hurry. Normally the user will do it line by line but
this scenario needs to be supported.

Any quick tips on how to proceed?


thanks
There does not seem to be any need for a form for this task. Forms are user
interfaces, not code interfaces. Sure, we could tell you about Sendkeys and
other such wrong-headed, error-prone kludges, but we would not be doing you
any favors.

A simple Update query would seem to be the approach to take. I would create
a saved update query that updates the field in question and run the query
via the command button using currentdb.execute.


I've just seen this:
Quote:
Now an auto-calculation can't make intelligent decisions about what the
figures might or should be. However we can simply subtract Actual from the
Budget for each line.
In the above example that would be $250. That figure is entered into the
projection textbox as though the user were there tapping away.
Quote:
So why not:

currentdb.execute "update tablename " & _
"set projection = budget - actual"

Or put that sql into a saved query and use a macro to run it instead of VBA
if you're not comfortable with VBA.

No form needed.

If there is more to this calculation than a simple subtraction, tell us
about it so we can properly advise you.

I see from reading the thread that discussion of proper application design
irritates you, but I can't continue without advising against storing the
result of a calculation. If you wish for a further explanation for the
reasons this is not advised, ask and I will explain. Otherwise, simply
ignore this paragraph.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.