A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

FORMS



 
 
Thread Tools Display Modes
  #11  
Old August 14th, 2005, 12:19 AM
AFKAFB
external usenet poster
 
Posts: n/a
Default

tina
if the text control name is 'txttotal' should the code then read as

Me!txttotal = (Me!Quantity * Me!Price)

and this goes in the Forms Before update event

chris

  #12  
Old August 14th, 2005, 12:25 AM
AFKAFB
external usenet poster
 
Posts: n/a
Default

tina
i'm now getting a message
'MS Office can't find the macro 'Me!txttotal=(Me!Quantity * Me!Price)
am i just useless......
chris

  #13  
Old August 14th, 2005, 03:02 AM
Rick Brandt
external usenet poster
 
Posts: n/a
Default


"AFKAFB" wrote in message
oups.com...
Rick
I musat be either blind or mad - so before you lose total patience with
me
this is what i've done

i've bound the control source to the data field 'total' in the table

On the Other tab i've called the name property 'txttotal'

in the event tab for 'Beforeupdate' i've inserted Me.txtTotal =
Me.Quantity * Me.Price


Whoa, there's the problem. You don't enter code directly into the event
property box. From the list of drop-down choices in that box choose "[Event
Procedure]", then press the build button [...] to the right. That will open the
code window and that is where you enter the code.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #14  
Old August 14th, 2005, 05:37 AM
tina
external usenet poster
 
Posts: n/a
Default

"Whoa, there's the problem. You don't enter code directly into the event
property box. From the list of drop-down choices in that box choose "[Event
Procedure]", then press the build button [...] to the right. That will open
the
code window and that is where you enter the code."

from Rick's earlier reply in this thread. and to tack a bit onto it: when
the code window opens, your cursor will already be at the spot where you
need to insert the code - so don't move it unless/until you are sure you can
find your way back to the same spot!

am i just useless......


no, not at all. you're not too familiar with the Access software, i think,
and perhaps a bit timid about digging through Access Help for clues.
(although i will say that Access Help is very frustrating to work with
unless you already know a lot about what you're trying to do - and even
then...!) and we're all trying to give you solutions that require a certain
skill level or at least familiarity with both the software and the
nomenclature. this is a common situation here in the newsgroups, because
Access is way too complex to actually teach someone to use it in this
forum - so we all have to settle for trying to communicate specifics.
suggest you get a good basic book on Access, if you haven't got one already.
you can learn basic techniques while at the same time learning the meanings
and proper use of terms - fields versus controls in a form, for instance
(they're not the same thing). the result will be a solid foundation on which
to build more advanced techniques, and a common vocabulary which will allow
you to communicate database issues clearly, when you need to, and understand
the responses better.

meanwhile, hopefully we've all helped you with a solution to your current
question (though we all agree that it's not a good setup you're building).


hth


"AFKAFB" wrote in message
oups.com...
tina
i'm now getting a message
'MS Office can't find the macro 'Me!txttotal=(Me!Quantity * Me!Price)
am i just useless......
chris



  #15  
Old August 14th, 2005, 09:56 AM
Baz
external usenet poster
 
Posts: n/a
Default

"AFKAFB" wrote in message
oups.com...
tina
i'm now getting a message
'MS Office can't find the macro 'Me!txttotal=(Me!Quantity * Me!Price)
am i just useless......
chris


Hi Chris,

Maybe you've got it sorted by now with Rick and Tina's help, but, just in
case you haven't, here is my step-by-step guide to what to do:

1. Create a text box control on your form and name it "txtTotal"
2. In the properties window for txtTotal, set it's control source to the
following:

=[Quantity] * [price]

3. With the form still in design view, open the code window (View
menu--Code)
4. At the top of the code window, there are two drop-down lists. In the
left hand one, choose "Form", and then in the right-hand one, choose
"BeforeUpdate"
5. At the insertion point, type the following:

[Total] = [Quantity] * [price]

i.e. you should finish up with an event procedure looking like this,
although Access provides the first and last lines for you, you only need to
enter the middle one:

Private Sub Form_BeforeUpdate(Cancel As Integer)
[Total] = [Quantity] * [price]
End Sub

6. Note that there is no need to create a hidden text box.
7. Observe that it now works, congratulate yourself on everything you
have learned, and then remind yourself that this is STILL a bad idea!


  #16  
Old August 15th, 2005, 06:55 PM
AFKAFB
external usenet poster
 
Posts: n/a
Default

All
that worked
thank you
i can see now why its not perfect and far from ideal
i've posted another question earlier today called 'Database Design'
which is concerning me more - if you're able to could you please take a
look at it.
thank you
chris

 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with custom forms not displaying, (using outlook form ins Katherines01 Contacts 1 January 13th, 2005 02:25 PM
Forms Will Not Save accessquestion General Discussion 1 January 12th, 2005 08:28 AM
General question about naming conventions for forms Mister John Doe Using Forms 1 January 6th, 2005 01:31 AM
Menubar listing open forms? Harmannus Using Forms 0 December 23rd, 2004 12:33 AM
Advantages of unbound forms? Rob Rutherford Using Forms 2 December 9th, 2004 07:48 AM


All times are GMT +1. The time now is 03:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.