473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Saving Form info to table upon button selection

43
I have a form with three (3) buttons, each performing a different function. My problem is I can't get it to save the information choosen/entered into the combo boxes and\or text boxes. My intention is when the user clicks on a button, the information choosen/entered on that form saves then procees to the next step. Can anyone tell me what's wrong with my codes (I thought Access auto saves, but I guess not).

Expand|Select|Wrap|Line Numbers
  1. Private Sub GOOD_Click()
  2. If Not IsNull(Me.SN.Value) Then
  3.     LastPosSN = Me.SN.Value
  4. End If
  5. If PosPullTestCount = Me.PullTestNum.Value Then
  6.     MsgBox "Time to perform a pull-test on a scrap cell!"
  7.     PosPullTestCount = 1
  8.     Me.Text30.Value = Me.PullTestNum.Value
  9.     DoCmd.OpenForm "GeneralTabPullTest"
  10.  
  11. Else
  12.     PosPullTestCount = PosPullTestCount + 1
  13.     Me.Text30.Value = Me.PullTestNum.Value
  14. End If
  15. DoCmd.GoToRecord , , acNewRec
  16. Me.CreationDate = Now()
  17. Forms!GeneralTabPullTest!LotNumber = Me.LotNumber
  18. End Sub
  19.  
I not sure what code to use or where to put it.

Thanks
Mar 26 '13 #1
2 1097
Seth Schrock
2,965 Expert 2GB
Access does auto save, but only on certain events. For example, the value you enter into a control does save until you leave the control. The changes to a record don't get saved to the table until you leave the record.

The code to save a record is DoCmd.RunCommand acCmdSaveRecord. If you always want the record to save, then you should put this between lines 1 & 2. If you only want it to save on a certain condition, then you should put that condition before the rest of your code.
Mar 26 '13 #2
tmdrake
43
this worked, Thanks Seth.
Mar 26 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Marty | last post by:
Hi, I want to save the form position when the user close it. I tried to place the coordinate saving code in my destructor, but it is not triggered when I assign the form to null. Where...
3
by: Mike | last post by:
Hello: I was not able to find a regular ASP group, so I posted this here instead. I have a web app which is actually just ASP using VBScript as the server-side language, running on IIS6. ...
3
by: KayC | last post by:
Hi Background info: I am running Access 2000 I have a form bound to a blank table When a user clicks a button the form opens in datasheet view User enters data into form and closes form User...
4
by: assgar | last post by:
Hi I am stuck on a problem. I use 3 scripts(form, function and process). Development on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. The form displays...
1
by: devagupt | last post by:
I have 2 tables , Production table and the Total table. The production table is made from a form and the total table just has data in it. I need to populate 2 fields from the total table into the...
3
by: joseph.mccastlain | last post by:
Hello All, I am a new user to Access. I am currently designing a database consisting of four tables for multiple users. Rather than bore you with the goals and such, here is what I am...
0
by: Gary W. Smith | last post by:
Hello, I have a simple form with a radio button group on it and I need to do some basic validation based upon which button is checked. Here is a little more detail. if button one is...
1
Run2Eat
by: Run2Eat | last post by:
i feel like this is a doofus question... but i've created an access form and added a find record button, but when i use the form, the find record button searches the form itself, not the table. all...
0
by: JRough | last post by:
Hi, I have a page with a form that is included into a php page. It has some php variables which are headers based on the user choices. In the form I will send some mysql data columns but right...
6
by: mfaisalwarraich | last post by:
Hi Everyone, I am new to javascript. I want to load 3 forms which depends upon the selection of a value from Combo Box. For example i have a combo box on a page and it has three values Form1,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.