I'm having trouble saving inputted information from a form to a table on MS Access, any help would be greatly appreciated.
I have a table : Inventory,
and a bound form to that table : InventoryForm
I want to be able to save the inputted data on my Form to either a query or table, so that i see what parts are being taken by each employee (from 'inventory'). At the moment the form is updating the inventory table, reducing or adding parts as done by the form, but it wont save who took what parts in that table.
Is there a simple way that i can link this form to another table/ query to track the changes made to inventory ?
I have a save button with some VBA that, when pressed, updates the inventory list, but i just want to track the transactions too.
The code is:
Private Sub SaveButton_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
End Sub
Any ideas how i could do this? From watching tutorials online most people's info from the form will save directly to the bounded table, so any help would be greatly appreciated.
Thanks - Mark
Related
Although a straight forward task, for a reason unknown to me I cannot update/refresh the combo box.
For the sake of simplicity, lets assume I have a table with a primary key, lets call it PK_Number (it is an integer number) and then I have 7 fields (6 field are required to fill in) of various types.
Thus all of the fields belong to a single table.
The PK_Number field I made it a combo box. I did this because when any PK_Number is chosen from the drop down list all the other field should change accordingly
When I try to build an After Update event with the macro builder and choose the Requery command I get the two following pop ups
Now, it is highly unlikely that the database is read only. i made the db and did not make such a thing.
There are couple more questions i want to ask but first i need to overcome this obstacle.
ALthough initialy the row source of combo box belonged to a junction table, i also changed the row source to the master table but without any luck
Can anybody help me out?
Thank you!!
i was able to solve it.
generally speaking the method is to avoid using macros and use VBA instead :-)
besides the fun:
i made a form with all the needed fields. however i also made an additional combo box that will be used to search all records and when the PK changes to change all other related fields
Lets suppose that the combo box name is cbo_PRF_Number. in the after update event i typed the below procedure.
Private Sub cbo_PRF_Number_AfterUpdate()
If Not IsNull(Me.cbo_PRF_Number.Value) Then
Me.txt_PRF_Number.SetFocus
DoCmd.FindRecord Me.cbo_PRF_Number.Value
End If
End Sub
Kindly note that in order for the above to work it is needed to make a bound text box with the same ow source as the combo box.
I'm looking for a general good practice solution to this problem. I don't need any specific code, and I've already come up with hacky ways to do it.
So I have a group of users (group1) in a database. Each user has a first name, last name, and hometown.
The current setup is each row is three pre-filled input text boxes (firstname, lastname, hometown), and a delete button. Below all the rows, an 'add' button, which adds a row of blank text boxes. The admin can edit, delete, or add multiple rows, then press save (or cancel). Now what?
The simplest implementation I thought of was to send it all of the data back to the server (.NET MVC) in a form. Then I delete all of those users (group1) from the database, and insert into the database what I find in the form. That way I don't have to worry about what's an insertion, deletion, or edit.
This is clearly not the best way to do it. Any suggestions? Clearly I should just be sending back data that changes - the edits, insertions and deletions. Would using Angular.js with this offer any helpful patterns?
Create a parent List in Javascript for Users. Add child lists to it. 'editedUsers', 'deletedUsers', 'newUsers'. Populate the lists and send them to server.
Basically you are just keeping a track of all the operations performed by the ADMIN; till he hits save button.
I am using Access 2010 to build a database. The database is updated regularly by an intern so I am trying to make it as simple and user friendly as possible. I have created a form for entering records.
These records are based on minute by minute information so much of the information - like date, name, category, etc - is the same for multiple records. Therefore, I want these broader fields' contents to carry over when I reset the form for the next entry.
This is probably a common question and I have researched many forums, but non provide guidance on how this can be done without the use of any macro or VBA. Can this be done without it? If so, how?
You need to use VBA. It's real simple though:
Private Sub Form_AfterUpdate()
' Add a line for each control that is to "remember" the last value entered
' and use that for the default value of the next new record created
Me.[MyControlName].DefaultValue = Me.[MyControlName]
End Sub
I am using formit in modx to create a form for the user to fill in. I then created a snippet to store the data from the form so that I can write it into my database. I followed closely to Bob's guide: http://bobsguides.com/custom-db-tables.html and I have searched online where similar approach has been made. However, my problem is that only one entry is stored each time. In other words, my table has only one record despite the fact that more than one user has filled the form and the record does not get overwritten. For new record to be stored, the current record must first be deleted. I am not sure what might be causing this problem. Makes no sense? Any suggestions would be much appreciated.
I constructed an Access database for a group of end-users. This database is composed of one table, tblInventory, and several queries for them to edit their data quickly/easily. One of my queries, for example, is:
UPDATE tblInventory SET Amount = Amount-[Enter Amount]
WHERE ((([tblInventory].Equiptment_Name)=[Enter Name]));
This worked great in my opinion, but I have to please the end-user after all. They requested that I make a form and use buttons to update the data in the table for them. I have the form laid out like this:
The Equipment_Name and Amount boxes pull their information from my table, which has categories named that. My Unbound textbox field is where I would like them to be able to enter the number of the given part they would like to take out of inventory. The button should be to run my query above, but instead of prompting for inputs I would like it to use what they entered into the textbox. I've tried many different things and searched many different sites but cannot find what I'm looking for.
P.S Equiptment_Name and Amount are the only 2 datafields in the table besides other fields I have in the table to serve as more lenient ways to search for data when they entered in names. These fields are called things such as Alt_Name1 and have no real relevance to the form.
Thanks in advance for any help given.
There is a couple ways you can do it but the simplest way is:
Build your query as a predefined query(ies)
Build a Macro that disabled warnings then executes your query or queries in the order you wish to execute them.
Go to the form Define the button.
Go to the event tab.
Build an event
Set the OnClick Event to the name of the Macro.
Save and Test.