Updating Only A Control ?
May 5, 2006I'm trying to update a control only.
The control updates if I do
NameOfForm.requery
Yet it doesn't update if I do
NameOfForm.NameOfControl.requery
Why not ?
I'm trying to update a control only.
The control updates if I do
NameOfForm.requery
Yet it doesn't update if I do
NameOfForm.NameOfControl.requery
Why not ?
I have a number of combo controls in a form. When I select various values from the pull down menus - and then exit to another form I find that the selected control values are not sync'd back to the table. The only way I can seem to cause the commit is by selecting the next record using the record navigator. Is there some setting I can use - or VBA - that causes a hard commit?
John
I'm not very familiar with Access but I need to modify an existing DB. I have added new values to it and they should appear into the source control drop down menu but only the original values appear. How or where those values can be added or updated??? I'm attaching some pictures ....
View 5 Replies View RelatedI'm supporting some Access/VBA code which includes the following behavior:
When an update is made in a (linked) child form, the current date/time is written to a textbox on the main form via
Me.Parent!txtMod = Now
Likewise, the BeforeUpdate event of the main form updates the same field (and then does a bunch of form validity checks, possibly followed by a Save).
When we upgraded to Access 2003 from Access 2000, a problem erupted:
When the user returns to the main form (by clicking on any control outside the subform), the following message is issued: "This record has been changed by another user since you started editing it (etc.)..."
At this point the user must choose between "Save Record", "Copy to Clipboard" and "Drop Changes".
Conceptually, I see why this is happening (though I wonder why Access 2000 didn't flag it). The subform is the "other user". When the main form is returned to, it is "Dirty" (unsaved update), so the main form's BeforeUpdate event fires, and attempts to update the field again (Me.txtMod = Now). Since there is a pending change to the field, an error dialog pops up.
As a quick fix, I replaced the code in the subform with a flag ("Hey, I've been updated!"), which the main form checks on the Exit event of the subform control. But that seems a horrible solution. Surely there's a better way?
Notes:
1. It would be preferable to have the timestamp updated right away by the subform, though having it updated when the subform loses focus is better than nothing.
2. Since a subform is a control from the main form's perspective, I'm surprised that a change to that control doesn't render the main form "Dirty". I guess from a database standpoint it makes sense (the form's table isn't getting updated at all; just the subform's). But then, how does the main form know that the subform has been updated?
3. I tried catching the error via Form_Error. I can make the dialog not appear via "Response = acDataErrContinue", but unfortunately it defaults to dropping the changes (old and new), rather than saving the new.
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.
I added a new field to one of my tables and query, but when I try to add a control for that field into my form it is not recognising it and the field isn't appearing in the sources for the form, even though the table is sourced to the form? Or am I going to have to do the usual and redo the entire form because I made a minor adjustment?
View 1 Replies View RelatedI have a form with a tab control, inside the tab control I placed an ActiveX control (Microsoft Web Browser). These are at the bottom of the form.
Everything displays fine if the entire form fit on the screen but if the form is too long and I scroll down the browser control is getting obscured by the tab control and getting chopped off (the contents are covered). It is as if the browser control is staying in space where it was and moving behind the tab control as I scroll.
This problem does not occur if I place the browser control directly on the form. Also I note that the browser control is sitting correctly within the tab control.
I have been through all the settings and properties of both controls and haven't been able to fix it. I searched all over the web but no one has previously stumbled across this one by the look of it.
See the attached image ...
I have table that I had to add a new field to which we update with a form. I tried to add a control for the new field but the field does not show up in the list for the control source. I am trying to add a list box to the form with a blank and 5 options.
I have attached screen shots of the table design and the form. The table has the field in datasheet view and I have manually entered a few entries in it but it still will not show in the control source for the form control. The top section of the form is where we enter and select the data for the new records. The bottom section (circled in red) autofills the matching record, from separate tables, for updating with the new entries.
I have added form controls for modified fields in the past so I am confused about why this is happening.
OK. I have searched and searched and every thread dances around similar situations but none seem to address this particular one. I am trying to make a control on a sub form visible/not visible depending on the condition of a control on a main form. The catch is that the control I'm trying to change the state of is on a subform located in a tab control. I've tried a thousand combinations and none seem to work. How do I reference the control on the subform in a tab control?
Main Form: frmMemberMain
Tab Control: TabCtl12
Tab Control Page: 2
Subform: frmChildren
Control on subform: txtRelationship
Can someone please help before my brain explodes!! Thanks! :eek:
Hi,
I have reviewed the posts for 'Control Validation' and dowloaded the sample database kindly posted by ansentry.
In the PaymentAmount example, a name has to be entered in the first control before an amount is enterered in the second control. If the controls and tab order are reversed, the validation doesn't work.
I have a form where the 1st Control needs validating before moving on. The code below doesn't work.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.Employee_No) Then
MsgBox "Employee No Required", vbCritical, "Data required "
Cancel = True
Me.Employee_No.SetFocus
Exit Sub
End If
End Sub
Any help greatly appreciated.
John
I have a form with a combo box. If the supplier(s) name is not in the combo box, it asks do you want to add that supplier address? If yes, a popup form displays, where the name and address are entered. THis updates the table. But the problem is the combobox doesn't refresh so the user isn't aware that it has updated.
I've tried updating the form, but that results in the question being asked again, do you want to add that supplier address.
Here is my code
Dim intNewCategory As Integer, intTruncateName As Integer, strTitle As String, intMsgDialog As Integer
' Display message box asking if user wants to add a new category.
strTitle = "Shipper Database"
intMsgDialog = vbYesNo + vbQuestion + vbDefaultButton1
intNewCategory = MsgBox("Do you want to add this Company and Address to the List?", intMsgDialog, strTitle)
If intNewCategory = vbYes Then
' Remove new name from CategoryID combo box so
' control can be requeried when user returns to form.
'DoCmd.RunCommand acCmdUndo
' Display message box and adjust length of value entered in
' CategoryID combo box.
strTitle = "Name Too Long"
intMsgDialog = vbOKOnly + vbExclamation
If Len(NewData) > 50 Then
intTruncateName = MsgBox("Name of the Supplier can be no longer than " _
& "50 characters. The name you entered will be truncated.", _
intMsgDialog, strTitle)
NewData = Left(NewData, 50)
End If
Hi all
I have a curly problem
A sent a mate a DB a while ago and I want to update it for him... so I need to send him something that will automatically update the forms, queries etc... progamatically i.e without him having to do anything to it.
Ideally, I'd like to front end/back end the DB. But server infrastructure doesn't allow for this. 2 networks are operating and they don't talk cleanly. Essentially, a FE/BE DB will work on one of the networks but not the other. Therefore, the DB is one whole DB so that BE tables don't need refreshing.
The way I see it... I have 2 options. Or maybe there are other options??
1. Export forms, queries etc... to the old DB or
2. Import the data tables into the new one.
At this stage I prefer option 2.
I have some idea how do this this but would appreciate some advice. Ideally, I'd like the user to click an update button to import tables, delete the old DB and transfer the new DB into the appropriate folder (and maybe rename the DB if it needs it??)
Any help appreciated.
I want to make an update code without referring to the form
My update query reads in is sql as follows
Dim SQL As String
StrSQL = "UPDATE products SET products.new = [products].[grossprice]-[products].[grossprice]*28/100"
I want to rewrite it in the following way :
Dim Diff As String
Diff = [products].[grossprice] - [products].[grossprice]
SQL = "UPDATE products SET products.new = diff*28/100 "
However this effort fails since i have to refer to a form.Can i build a code without referring to a form?
Hi,
I have a database that has been in use for sometime but it needs some amendments.
I have burnt the db to cd and plan to make the updates and then take it back and import the tables from the one in use to the newly updated database.
I remember trying this before and it wouldn't let me import the tables as it said they had relationships.
Surely there is an easy way to do this? I don't have to delete the relationships, import the tables and then re-do the relationships?
Many thanks,
Housey
I have a database with details about employees in it.
There is a field with yearly salary in it and another with an ID number. Recently these slaaries have been increased by a non-standard amount. I have another table with the emplyee ID number and their new salary. I need to update the slaary figure in the first table with the salary figure in the second table. Is there anyway of doing this?
Any help would be most appreciated
Nick:)
I need to be able to update all the date records in a table using an update query. Any ideas of what i have to put in the 'update to' box to get all the dates to change from dd/mm/2005 to be dd/mm/2006
cheers for any help
Hi there people...i'm doing a databae project for A2 level coursework and have encountered a problem..please help me if you can.
I have a table of names. Also another table (actions) which contains several fields, but 2 of them are names, (1 being Proposer, and other being Actionee), are obtained from the names table.
However, when altering for instance the spelling of one of the names in the names table it does not update the spelling in the actions table. i have tried using the relationship-update option but this doesn't work because the names appear more than once in the actions table. if it were to appear just the once in the actions table then i wouldn't have any problem. but it is a requirement that the 2 names fields are in the actions table.
Any ideas of how to solve this?
can someone tell me how to make a form's data change when related data is changed in another form. E.g. If I change the price of a product in 'products' to £3.00, how do I make it automatically show that it is £3.00 in 'orders' just by typing in the product code?
View 1 Replies View Relatedhi everyone,
I have a "subformB" wich is inside a "MainForm". When "MainForm" loads up (and therefore subformB loads as well), "subformB" does not show the results it is supposed to show until I click on it. It doesn't update itself 'till I click on it. Can anyone give me a hand on this?
Thank you very much
I have used a make table query to create a table with text values. I need to convert these values to numerical data, for instance "Male" should become 1 and "Female" should become 0. I tried doing this in an update query, but had to use 2 separate queries. Don't know if a macro would work to update a table (there are no forms in this DB, it's all data fields). Same with code, I usually do this with forms. How can I update the raw data, which in some cases has multiple ifs, into the correct format? Thanks!
View 4 Replies View Relatedi have 4 tables in access and i need to be able to add information in one table and it to appear in the other 3 without me having to go in to each individual table and enter it.
Is this possible?
I have two tables. One table is linked to a text file that is always update by the another program. I have another table the is same exact one but it does not get updated.
I have access run these two tables to see the difference between. (Its basically and add/drop function) But after I run those two tables to see the difference, I want to update the nonlink file, so it is up to date with the "link" table. Thank you.
Good morning, I'm a newbie....and I inherited this db.
I have an existing table. I need to add two rows of information. When I add the rows, they are empty. I have tried running a query with all the fields from the table plus the two rows I need, but I loose 90+ records. What am I doing wrong???
Thank you for any help...
Here's my problem:
I have a table called WorkOrder. I have fields labeled:
JobID, which is an autonumber
WODate, which is formatted as =Date()
and WOID, long integer
Here's what I want to do and have done:
On my form I have WOID control source set to:
=Format([WODate],"mmddyy") & Format([JobID],"00")
I know that storing calculated values isn't the preferred method but it's what I've done.
The problem is I have a cmd button on the form, that when clicked asked for the WOID. This button is based on a query to print a specific work order.
The problems is that this calculated value (WOID) isn't appended to the table so nothing exists when the cmd button is click and the WOID is entered.
How can I update the table with this WOID for the specific job?
I have two tables. One table is linked to a text file that is always update by the another program. I have another table the is same exact one but it does not get updated.
I have access run these two tables to see the difference between. (Its basically and add/drop function) But after I run those two tables to see the difference, I want to update the nonlink file, so it is up to date with the "link" table. Thank you.
I have a table which contains dates in the format (mm/dd/yyyy) as well as other information, I am trying to get an ASP website to update the date with values chosen by the user. The problem is that when using the UPDATE command it returns an error, saying the syntax is wrong. Here is my SQL statement and the error message it produces, if anyone has got any ideas, please let me know -:
"UPDATE Users SET Name = '"& UpName &"', DOB = #"& AddMonth &"/"& AddDay &"/"& AddYear &"# WHERE ID = "& ID &" "
The error message I get in return is -:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression '#//#'.
Thanks in Advance
Andy