Updating By Using Form
Mar 24, 2006
I have a table with book information. I want to be able to change information in that table by using a form. Is there a way for when the form opens, to type in the books number to bring up that information so I can change it?
View Replies
ADVERTISEMENT
Dec 16, 2014
I have a form that has combo boxes and text fields (as well as sub forms). There is also a button linked to some code that says'
Private Sub cmdQuote_Click()
'Creates quote date and prints quote
Me.QuoteDate = Now()
Me.cbAgentID.Requery
DoCmd.OpenReport "Quote", acViewPreview, , "BookingID = " & Me.BookingID
End Sub
When the button is pressed the QuoteDate field (it is bound) should be be populated, but unfortunately it is not. I have played with refresh and requery but cannot derive a solution.
View 1 Replies
View Related
May 21, 2005
I have a table called Primary Employees and another table called Secondary Employees. I also have a form where you can add new employees, which updates the Primary Employees table. What I would like to do is, after I add a new employee have the new data update both the Primary and Secondary table at the same time. These tables have the same information within them. These two tables are currently relational to one another, but I still have to go in and manual update the Secondary Employee table after I add a new employee. I have to have two databases because of other form requirements. Any help you could provide would be greatly appreciated.
View 4 Replies
View Related
Jul 26, 2007
I have 2 fields in a form called 'Employee No's' which use a combo box (this information for these comes from a query). However, I have another form called 'Employee Details' (this form comes from the same table as the query is taken from).
The 'Employee No's' form opens by a command button in the 'Employee Details' Form. However, what I need to be able to do is for the query (used for the combo box) to update with information I have just put in the 'Employee Details' form while I have not yet closed the 'Employee Details' Form.
Would I use an SQL statement for this? If so what would I put?
View 1 Replies
View Related
May 9, 2005
Hey guys..
For some reason, after i added new records to my table, the fields on my form don't update... :confused: .. any idea why and how i can solve this problem ?
any help will be appriciated.
View 5 Replies
View Related
May 14, 2005
How would I go about updating a table from a form? My table consists of employee contact information, ie.. Cell phone, pager number, home phone.
I have created a forum with unbound combo box called employee. As I choose the employee name all other fields are populating just as i want. After I update the form with the correct system contact information i want to be able to save the data and have it update the table. It appears the only data not updating the table is the anything in the combo boxes that are unbounded. Any suggestions?
View 3 Replies
View Related
Jul 4, 2005
If you open the attached sample db you will see that I have a cascading combo box (It is working fine).
The data for the tables that are the source for the combo box are imported from an excel sheet.(This works fine)
Now my problem the data from excel is variable after the data is imported into access I want to add to it items from another table.
After the data is imported into both tblModel and TblParts I want to append to tblParts each item from tblFixed for every Model.
If you open tblPartsEXAMPLE you will see what I want to do (I added this manually).
I hope that my expanation is clear and someone can offer some advice.
Thank you in advance.
View 2 Replies
View Related
Jan 26, 2006
Ok so ive built a form that a user can use to enter in data that will update a certain table.
The table has for fields: Email, Password, Active and ID.
In my form ive got rid of the active and ID fields as i want them to update automatically when the user fills in the email and password and hits the submit button on the form.
The only problem im having is getting my head around how i would update my other two fields once the user clicks submit?!
i was thinking that i could simply code the submit button to add the relevant info into the fields eg onclick active = 1 and ID = previous id +1 but im completely lost
Any help or ideas?
View 1 Replies
View Related
Mar 10, 2006
I have been struggling with this for weeks now and it must be fairly simple.
I have a form linked to a table with the fields
number
road
town
and
partnernumber
partnerroad
partnertown
I input the first 3 fields and I would like to be able to click a command button and copy those 3 fields to the last 3 fields to save extra typing. I cannot get the command to work though.
any help appreciated
thanks
View 7 Replies
View Related
Aug 8, 2006
hi guys i have a list box which has 4 columns that come from a query. when a user double clicks a selected item, i want the frmUPdate to open with the selected item; it gives me no error it just always goes to the 1st contract . have no idea what else to try...
here is the code:
Private Sub List33_DblClick(Cancel As Integer)
Dim rs As Object
DoCmd.OpenForm "frmUpdate"
Set rs = Forms!frmUpdate.Recordset.Clone
rs.FindLast "[ContractID] = " & str(Nz(Me![List33]))
If Not rs.EOF Then Forms!frmUpdate.Bookmark = rs.Bookmark
DoCmd.Close acForm, Me.Name
End Sub
View 5 Replies
View Related
Aug 10, 2006
on my form i have a few radio buttons, check boxes, text fields and combo boxes. i am able to change and update all fields except combo boxes. it modifies the wrong table...
combo_table
------------
id value
1 house
2 school
3 work
if on my form the combo box for a specific record shows house selected, the value of 1 (the id from combo_table) should be the value put in the main talbe...if this is changed to option 2, school, the main table should have 2 in that field...
what happens though, is if i change from 1 (house) to 2 (school) combo_table ends up looking like the following:
combo_table
------------
id value
1 house
2 house
3 work
View 4 Replies
View Related
Dec 30, 2004
Hey ya'll,
I'm trying to figure out how to subtract a value entered on a form from one table, from a column in a different table. I was trying to us an AfterUpdate on a texbox to run some VB that would run a SELECT statement to get the current value (InStock), subtract the value in the textbox, and run an UPDATE statement to update InStock. But all I got were a lot of errors saying that I was using mismatched objects and nothing was getting update. Please help.
Thanks,
Chris
View 4 Replies
View Related
Dec 30, 2004
alright I have a form and I need a couple of text boxes on there to add information to a different table than the other ones. I found this code somewhere on this forum can you tell me if I can use it for what I need, A more detailed explination of my project might be nessecary.
Code: sub AddRecord_Onclick docmd.setwarning false if not isnull(txtName1) then docmd.runsql "INSERT INTO table (areaname) VALUES('" & txtName1 & "');" txtName1.Value = Empty endif end sub
what is the proper syntex for the Insert INTO part, Table is obviously the table I want it inserted into, what is (area), is this the field I want it inserted into?
View 4 Replies
View Related
Feb 7, 2007
I want to create a form that will update a table. I have two columns, an item number and a paid column. On the form I want to plug in the item number and then I want to hit ok and it will find that item number and put a value (for example "X") in the paid column.
I have tried running an update query when i hit the ok button but I can never get to work
View 3 Replies
View Related
May 8, 2007
Here's the issue: I have a main form with a subform on it. The main form's record source is called "tblMainForm" with one field in it-MainFormPK-the primary key. The subform's record source is another table called "tblSubform" and it has three fields-SubformPK (the primary key), MainFormPK (foreign key) and DataEntry-a standard text field.
I want to create a new record so I open the main form and am immediately brought to the subform's text box whose control source is DataEntry. I enter something into the text box and close the form. What I entered into the text box is saved in tblSubform but the main form did not create a new record therefore MainFormPK was not automatically entered as the foreign key in tblSubform and there is no link between the forms. (By the way, the Master and Child fields are set properly.)
My question: Is it mandatory that the main form containing a subform have a data entry field? If not, does anyone know of a way around it? Thanks for any help.
View 3 Replies
View Related
May 28, 2007
Hi,
I'm new to access, but not new to databases in general. I'm having what should be a common problem/question, but I cant seem to find much on it.
For example, I have a standard table, with ID, text and a "yes/no" (lets call them booleans). I've made a query for that table - of only records with the boolean to no.
I have a form which displays the query. If it i put the boolean to yes, it still stays on the list until the form is opened and closed. This could be useful but if I want it to do it right away, what should I do? I didn't see any simple VB or macro command anywhere. Should i script open and close? Use a SQL command to update.
thanks
View 3 Replies
View Related
Feb 26, 2008
I have a form that opens a subform with a list of work orders by who they are assigned to. I would like to be able to close any or all of the work orders. When I close them, I need the timestamp to be updated, but I can't seem to figure out just how to make that happen. Any ideas?
View 3 Replies
View Related
Jan 31, 2005
First, let me point out that I am a new Access user, so apologies ahead of time
I have a form which has a field called 'Initials'. I want this field on the form to default to whatever was last entered (into the table called 'Main Table'). I first tried setting the default value with a DLast command, which seemed to work for a day or so, but then it returned values from mid-table - very strange
I then set up a query which does return the value of the last Initials entered (cunningly called 'Last intials entered'), but I can't get the field in the form to default to this value - it comes up with #Name?
Can anyone help, or have I not explained myself very well
Cheers
View 1 Replies
View Related
Mar 2, 2005
Hi
I have a continuous sub form linked to a main form.
The fields on the subform are:
Quantity
Part Number
Description
Code
Price
I also have a total price field for each record the control source for this is
=[Quantity]*[Unit Price].
I then have a text field to calculate the order total in the form footer control source is
=Sum([Total Price]).
The problem that I have is if I change the quantity in record 1, the text field to calculate the order total does not update until I tab onto record 2.
Have searched far and wide for the answer and have tried all manner of me.[mytextboxname].requery to no avail - help!
Thanks
Georgina
View 5 Replies
View Related
Jun 17, 2005
I've creating an Access project, which is at an early stage. I'm using Access 2003 with a default file format set to Access 2000.
I've been trying to update a date field within a table using this piece of code from a Calendar form. The Calendar form has a Command Button called cmd_Accept. Its sub routine is shown below. Both variables, dt (date) and fvr_id (field visit report ID) are global.
The code works - too well! Instead of updating the only the target record, it will either update the first record plus the target record or all records with the same date and I cannot understand why this should happen.
[Field Visit Report ID] is unique, being the primary key for the table, tbl_field_visit. It is AutoNumber generated. I've double-checked the table and all entries in [Field Visit Report ID] are unique. All my MsgBOX displays show what I would expect to see.
As you can see, I've also tried doing the same task using SQL - with exactly the same result.
I've been going round and round with this for days. Should I bin this and go down another route, or can anyone tell me where I'm going wrong?
Any help much appreciated.
Private Sub cmd_Accept_Click()
Dim dbs As Database, rst As Recordset
Dim strSQL As String
dt = ocxCalendar.Value
' +++++++++++++++++++++
' Field Visit Report ID now set from another sub routine. Tested and working.
' fvr_id = Form.[Field Visit Report ID]
' +++++++++++++++++++++
' MsgBox "The Field visit report ID is " & fvr_id, vbOKOnly
' MsgBox "The date is " & dt, vbOKOnly
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tbl_field_visit")
If rst.RecordCount <> 0 Then rst.MoveFirst
MsgBox "fvr_id = " & fvr_id & " Date = " & dt, vbOKOnly
Do While Not rst.EOF
If (rst![Field Visit Report ID] = fvr_id) Then
MsgBox "The Record ID is " & fvr_id, vbOKOnly
found = True
With rst
.Edit
!Date = dt
.Update
.Bookmark = .LastModified
End With
End If
rst.MoveNext
Loop
rst.Close
' If found Then
' vbButtons = vbOKOnly + vbExclamation
' MsgBox "Record Found! " & " Date = " & dt & " Field Visit Report ID = " & fvr_id, vbButtons
' If rst.RecordCount <> 0 Then rst.MoveFirst
' strSQL = "SELECT tbl_Field_Visit.Date FROM tbl_Field_Visit WHERE tbl_Field_Visit.[Field Visit Report ID] = " & fvr_id
' Me.RecordSource = strSQL
' MsgBox strSQL, vbOKOnly
' strSQL = "INSERT INTO tbl_Books ([Date], VALUES '" & dt & "')"
' strSQL = "UPDATE tbl_Field_Visit SET tbl_Field_Visit.Date = '" & dt & "' WHERE tbl_Field_Visit.[Field Visit Report ID] = " & fvr_id
' MsgBox "strSQL = " & strSQL, vbOKOnly
' dbs.Execute strSQL
' End If
dbs.Close
Set rst = Nothing
Set dbs = Nothing
fvr_id = 0
DoCmd.Close
End Sub
View 1 Replies
View Related
Jul 15, 2005
I have a combobox that displays information about a current record on a form (much like a subform would show all information related to a certain record). So for example, there is a user and the combobox would list all the users applications. Now, when the record is changed (via the navigation buttons) I want the combobox to requery, but I don't know where the query should go. I tried putting the requery under the primary key's afterupdate method, but no go.
Can anyone think of a solution? Do you understand my problem?
Thanks in advance.
View 3 Replies
View Related
Aug 7, 2005
Can anyone help?
I'm having trouble storing autofilled data from one of my forms and I was wondering if anyone has any ideas.
My data is as follows
tblProducts
ProductID
Description
Nett
tblPurchaseOrders
PurchaseOrderID
PODate
Supplier
tblPurchaseOrderDetail
PurchaseOrderID
ProductID
Description
Qty
Nett
Now I have a standard order entry form which works fine, my problem is with the subform:
frmPurchaseOrderDetail
ProductID
Description
Qty
Nett
On my form Description and Nett are auto populated referencing ProductID but this information does not transfer to the table tblPurchaseOrderDetail. The main problem is that a nett price can occasionally chanege (inflation) but I need to be able to look back to a particular order for audit purposes and be able to see what I paid.
I'm sure there is w way round this, but I've been unable to figure it out. I've gone through loads of different threads on the forum and as a result am sure it can be done, I've also looked at the examples posted by several users, but none seem to approach the lookup quite from this angle, does any one have any idea...sorry for the long post, thanks.
View 3 Replies
View Related
Jun 11, 2006
Hi all
I'd be very thankful if someone can please help me with this problem.
I have 1 Table. This Table is imported and contains data from Excel. It also contains fields I added manually. There is about 20 imported fields (full of data) and about 100 manually added fields.
Then I made a Query of this table. I made some calculations in this Query.
I then created a Form based on the Query. I then made a Combo Box. This Combo Box selects a customer, and then updates the other fields (the ones I imported from Excel) depending on the customer I selected.
So now what I want to do is this: I want the fields (updated from the query) and newly entered data to save to another newly-created table. Can someone please help me with this? Any ideas?
Thanks a lot. All input greatly appreciated.
kruger101
View 2 Replies
View Related
Jul 26, 2006
Help - I'm at a loss! I have a form that I am using for invoicing for a Trucking firm. On this form, I have three fields that I am having problems with. These fields are From, To and Mileage from a table named Location. The user selects "From" from a combo box then goes to select "To" from another combo box. The "To" field is a filtered list of only those locations which correspond to the "From" that was chosen. Once this is done, the corresponding mileage is automatically filled in and used for rate calculations. If the "To" that they want is not in the table, they can double click the field and a form to add a record to the table pops up. So far, so good.
My problem is that now the user wants to be able to add a record such as New York to be From and Miami to be To with 123 as mileage once and be able to have Miami as From and New York as To with 123 as the mileage if he needs on future invoices. Can this be done without having to enter it again?
View 1 Replies
View Related
Dec 20, 2006
Hi
Can any one help me with a quickey. I have a form which shows short details of a building ie name town postcode etc. I have another form with 3 subforms to be able to enter new details of a building, the new client and the new agreement. This works well and is feeding the new data into the correct tables. When I reopen the short detail form it doesnot display the new records. I have a short piece of vba which allows ne to see the full details of a site when I click on the site name.
A quick reply would be much appreciated.
Thanks
ChrisD
View 2 Replies
View Related
Oct 19, 2005
I have a form to enter records in a table of staff attending training courses, in the form is a sub-form based on a query from a different table. When a staff number is entered on the main form the staff name grade etc appears on the sub-form, my problem is that I need the table to be updated from the main form and the sub-form. Is there a way of doing this?
Thanks
View 1 Replies
View Related