Question:
Can you help me with Microsoft Access?
15fsg546rge1rrheljh45hjr90459ty3
2007-10-22 08:29:23 UTC
I have a form. Some of the text boxes on the form are set up to do calculations, and others enter into a table. I want the fields that are doing calculations to enter into the table as well for querying purposes. How do you do this? Seems like you can have a text box enter information into a table only if you are typing it into the box, but when there is a calculation there is no way to have it entered into the table. How do you do this?
Five answers:
2007-10-22 21:03:17 UTC
If your text box's Control Source is actually a field in the form's table (a bound control), you can update the table by adding some simple code.



For example, say I have a table with 3 fields: Quantity, Price, and Total. I want to make the Total = Quantity x Price. I add this code to BOTH the Quantity and Price "After Update" events:

If Not IsNull(Me.Quantity) Then

If Not IsNull(Me.Price) Then Me.Totoal = Me.Quantity * Me.Price

End If

What this says is if neither the Quantity nor the Price are "null" (blank) then do the math and make update the Total to Quantity x Price. You need to put the code on both Quanity and Price as you never know if the user will enter the data in the "proper order". I would also recommend making the Total field property "Enabled" set to "No". That way the user cannot enter something that does not make sense in that field.



If you need assistance in writing the code for your specific needs, please add that to your question or send me an email and I can help you.
2007-10-22 08:35:30 UTC
I think the best way to do what you are asking about is to go into the VBA code behind the form and do the calculations there. I don't completely understand your question, but if you wanted to get the value from a textbox you simply do



Dim myvalue as String

Dim theNumber as Integer



myValue = txtBox1.Value ' gets the value from the textbox



theNumber = Cint(myValue) ' converts the string to number



.... then you can do calculations on theNumber. You have to bring it in as a string, since everything from textboxes comes in as string types, then convert to number type for calcs. Hope this helps a little ???
2007-10-22 09:26:08 UTC
Carry out the calculations from queries and then update the tables.
imsaan
2016-09-05 23:42:32 UTC
Access and Excel are very unique from Word and Powerpoint. You will NOT be in a position to false understanding methods to use them. If the activity calls for any individual who's as much as pace instantly, you is probably not certified. It's a well factor to grasp earlier than you get employed and lose credibility (and such a lot more commonly your activity) inside an excessively quick interval of time. However, you'll be able to undoubtedly allow them to realize your present MS Office enjoy and your ability in Word and Powerpoint. Then state that you're inclined to be trained the opposite 2 as rapidly as viable. Some employers (like General Motors) furnish MS Office suites for as low as $10 for his or her staff use AT HOME. This is so they are able to train utilising it and hold up with what's used at the activity. (This is MS manner of constructing definite that every body else continues paying via the nostril the relaxation of the time.) Anyway, the company you're watching at can also be inclined to rent you on your different qualifications if you're inclined to take categories and are a rapid learner. You can seem on-line and uncover a path to be had that begins quickly (or instantly) and is as complete as viable in as quick a time as viable. (More on that underneath.) Then be ready through rehearsing anything to mention while this comes up within the interview. For instance, state actually (and succinctly) that you're no longer acquainted with Access and Excel, however you're a rapid learner, are have checked into and are inclined to take a path (identify it above all) to deliver you as much as pace as rapidly as viable. State that you just think your different qualifications could make this together moneymaking employment and that you just got here to the interview hoping to have the possibility to turn out that. I've integrated a hyperlink for Microsoft Office's possess FREE on-line self-coaching web site. You might also wish to seem up paid offerings earlier than the next day, so you'll be able to refer to those if requested. Remember that in the event that they outright state that you just are not certified for that function, you'll be able to nonetheless ask if they have got one more function that could greater fit your abilities, and to hold you in brain sooner or later. Even a referral to one more enterprise or a proposal on a role greater applicable is a worthy commodity this present day. And I do wish you'll be able to get the activity.
hassan
2007-10-22 08:44:46 UTC
firstly you take the text box and then press F4 or right click on it to go its properties.then you can choose the data type of this text boxes is numbers then yous problem is solve.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...