Unbound Text Field In Continuous Form: Update One Record, They All Get The Same Value
Feb 20, 2006
Hi,
I want to show some text from another table based on the values of the bound fields in each record of a continuous form. I thought it would be easy, but I can't get it to work.
I step through the records in the bound recordset and use some of the values to query another table. Then I use the value from the query to populate the unbound text field.
It works fine for each record. But every time the unbound field is updated, all the records in the continuous form are updated.
I'm stuck on this one. It's probably something simple to fix - if you know what to do!
I have a continuous form with a text field that says "Select". There are two other fields, one of which is Brand. When the Brand Combo box has nothing in it I want the text box to appear (instructing the user to select a Brand) But once the user selects a Brand and goes to the next records, I would like the "Select" in only that record to become not visible. I tried conditional formatting but can't apply that to an unbound control ( or at least it is grayed out when I select the text box) and any other possible solutions I have found changes all of the selects - not only the one in the changed record.
I have a table here tblTemp with a field client. This table can have from 1 to 100 records at times as it keeps getting cleared for the purpose of this exercise.
I also have a form frmLabel1Data with an unbound text box txtclient.
I was hoping to get the first record of the table into this text box upon opening the form.
I tried creating a query which gave me the following sql;
SELECT First(tblTemp.client) AS FirstOfclient FROM tblTemp;
I also tried placing it in this code with no luck
Private Sub Form_Open(Cancel As Integer)
Dim SQL
SQL = "SELECT First(tblTemp.client) AS FirstOfclient FROM tblTemp;" MsgBox SQL
End Sub
Does anyone know why I cannot see the same result as when I open the query it gives me my client name but the code above does not????
How to do an UPDATE using VBA on a form to update a specific record on the table using an unbound field on the form to filter the update.
Every time the code runs, it tells me: Run-time error '3144': Syntax error in UPDATE statement and takes me to the "CurrentDb.Execute strSQL, dbFailOnError" line at the end of my sample below.
I have a continuous form with a number of unbound fields and bound fields. However, I would like to sum an unbound fields (Text28). Text28 is an unbound calculated field based on another calculated unbound field (Text22). I would like to sum Text28 in the footer or somewhere in the form.
Here are the codes for my field:
Code: Text28 = iff([Text22>0], [Text22], [Text20] --- This works Text29 =sum(iff([Text22>0], [Text22], [Text20]) --- this is not working
As a part of reducing traffic on file server, I am planning to read less record on the form and hence I tried removing forms record source. (Attached sample db)
I kept all unbound textboxes onto the forms and save new record to the table using codes back of the command button. This is working great with main form. But doesn’t with sub form. I tried removing record source of sub form and keeping unbound text boxes to appear record if it exists.
If you enter 1 in InvNum text box on main form, you will find it brings record. I don’t want to show the record on the sub form unless I call it from main form.
How can I use the same trick of unbound text boxes with sub form too?
I have a Continuous subform based on a query based on few linked tables.One of those tables has a Yes/No field which shows in the subform.
I want to be able to change the status of this field for each record independently, so I placed an unbound check box in the subform Detail section and a Command button on the subform Header section. However when I click one record check box, all of them change, I did not expect that. How do I move forward to get this done?
I've created a data entry form w/ 7 fields.... [f1], [f2], [f3], [f4], [f5], [f6] are bound to a table. While [f7] is unbound and has Nz function.
Now, the value of [f7] is the summation of [f1] to [f5], i want that what ever value is generated by [f7] will be stored on [f6] in both forms and table...
I created an unbound text box on a form that automatically pulls the current logged in user by using this:
Private Sub Txtuser_Click() Me.Txtuser = Environ("Username")
The form grabbs the logged in user with no problems, however, I ultimately want this information to also end up in my table. So the form has three boxes (to keep it simple). The user will type their first name and last name manually on the form which the record source is this "table" where their name goes to the table last name =Field 1 and first name=Field 2 respectively. I want the unbound box from the form to place the logged in user in Field 3 for the current record.
I have a form with 1 unbound listbox as drop down list (entypolst), an unbound text box(entypotxt) and a command button. The list box reads items from a table. I want to change a value (text) on listbox, input a text on textbox so pressing the button add a new record in a table (Table1 fields Category,Product) showing in my form as subform (SFTable1) in datasheet view. For that reason a made the following code:
Code: Private Sub AddBtn_Click() Dim ans As Integer Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset Dim ctl As Control
[code]....
I take the error msg for 0 items selected in listbox and exit the sub.
I have some code for a button on click event to open a form and select the record which corresponds to a value in an unbound text box. The code is:
Private Sub Command25_Click() On Error GoTo Err_Command25_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmOpenPatientRecord"
[Code] ....
This works fine when I put in a 10 digit NHS number but opens a blank record when I enter a four digit or six character/digit PatientNumber. Both patient number and NHS number are text fields in the underlying table.
hi guys, i have a continuous form with a check box and a button on each record's row.
now if i dont bind the check box to a control source when you tick it, it gets ticked for each record, i am using the tick box to pass a state to the button ( uses an if statement ) so that it will done different things if it is ticked when the button is pressed.
can anyone help me to get this to work without having to bind the check box to a control source?
I have 4 fields that are unbound on a form. img1 img2 img3 img4..When these are entered they are all combined and autofill another unbound textbox = imagename.. what i would like to do is from this unbound textbox 'imagename' ..i would like to populate a textbox that IS bound called FileName
[Event Procedure] Private Sub imagename_Click() Me.imagename = Me.FileName End Sub
Access 2002 . Can I condition a field to 'locked' on just one record of a continuous form subfile, based on the contents of a 2nd field in same record?
I have unbound TextBox in continuous form and I would like that it never get focus. In property I specified Enabled=No and Locked=Yes. But it doesn't work.
in a continuous form i want to click on one record and have the one field change the background colour to highlight it. When I use the code: Field. BackColor = vbYellow it changes the background on all the records. Is there a code to say only for the record with focus?
So I have this code in an afterupdate event in an unbound text box to update the value of a table if the textbox is updated:
Code:
Private Sub txtCustRepID_AfterUpdate() 'Go to Calls table and find original value for CustRepID 'Fin the Call ID first Dim CallIDVar As Long Dim ContactIDVar As Long Dim CustRepIDOr As String CallIDVar = Forms![Contacts]![Call Listing Subform].Form![CallID]
[code]...
This code works well when entering numbers in the text box but it returns error 3061; "Too few parameters. Expected 1" when along with the numbers there is a letter in the textbox.The error happens in this part of the code:
Code: 'Accept change and add new value to table CurrentDb.Execute _ "UPDATE Calls " & _ "SET CustRepID = " & CustRepIDNew & " " & _ "WHERE CallID = " & CallIDVar, dbFailOnError
The underlying table has text as type of data for this field.
I have a continuous subform of 'static data' whose record source is a SELECT query across multiple linked tables.
Most of the fields are locked and purely there for information purposes but I need to be able to allow end users to change one particular field in each record if they need to - choosing a value from a predetermined list (i.e. one of the tables)
Usually, when I need to do this, I add a command button to the subform and use that to open a separate pop-up form specific to that record, from which the user can make whatever changes they like and then update the record. So in this scenario, a simple unbound combobox linked to that table, on that separate form, would work quite easily.
But I would prefer if users could make their changes directly from the subform without (yet another) pop-up form required each time, to make managing these records more fluid and less time-consuming.
So my thought was to use a bound textbox in the continuous subform (to take the existing value for each record), hide it and overlap it with a visible unbound combobox whose row source is the table of available options and whose default value is driven by the hidden bound textbox. And then to use the AfterUpdate event of the combobox to run the UPDATE query on the record in question.
However, while the combobox is getting the correct default value and the correct list items, I can't make a selection from it. Now I am aware there are 'issues' with using a combobox in a continuous subform but I was hoping I could circumvent them by not binding it.
I have a continuous sub form linked to a master form. The sub form contains fields such as [date], [increase], [lastdateincrease], [task], and multiple other fields. The sub form can have one record or multiple records linked to the master form.
Each sub form record represents a service, monthly cost, and a price increase amount. I'd like to be able to enter data in two fields and have this data populate any remaining records, or for that matter, new records that I had to the sub form.
The fields that I would like to have populate are [date] and [increase].
When I enter the [date] and [increase] in the first record, I'd like all remaining records in the sub form to update with the [date] and [increase] amount automatically.
My database has Main form and a Sub form. On main form i place one unbound text box named investigations. In subform of which datasheet there is a column named TestCode. I want unbound text box (Investigations) to display row values which selected in a column (TestCode) of subform.for example:Investigation field should display "CBC,HB,ALP".
I am running in to a brick wall with this. I have an unbound text box with the control source set to =IIF([text42]=0,0,[text42]/[text44])*100 and in continues to return a #name? error.
I am not sure how to get this expression to work. I have even tried to put =[text42]/[text44] and I still get the #name? error.
happy friday to all! I may just be missing something simple here but not sure what. I have a form with an option group of radio buttons, an unbound label, and an unbound text field. If radio button A is selected, the the label and the text field become visible. no problem with this.
when they become visible, I want to be able to enter a string into the unbound text box, and use that data to populate a query from. I know how to do this also.
No the problem: when the textbox becomes visible I can't type into it?