Disable Combo Box After Update?
Jan 5, 2007
Hello,
I have been playing around to see if it is possible to operate a combo box as a one shot operation.
I.e you make a selection from the combo box then the combo box is disabled.
Only prob is that I can't figure out how to do it.
Possibly by using a message box to see if selection is correct, if Ok clicked
then data entered and comboboc.enabled = false?
Or can this not be done.
B
View Replies
ADVERTISEMENT
Feb 10, 2005
Hi I have a simple check box that if ticked puts a big red Cancellation text across the record, how do I stop anybody unchecking it on the particular record...probably dead simple, tried loads of combinations but I can't get the right code,thanking you in advance
Dave Williams
Sunny Lanzarote in The Canary Islands
View 7 Replies
View Related
May 28, 2005
Hi,
Newbie needing a shove in the right direction. My option group will be confusing for a user because it defaults to the Male selection
of the Male / Female option. In other words, as the user views the form to scroll through the records, the option button will always be at the Male selection, regardless of what was originally selected to update the table field. Is it possible to hide the option group once it has been used to input that record, or, have it display the correct selection for that particular record?
View 2 Replies
View Related
Jul 27, 2006
Hi all,
I have a form that displays fields from two tables. I have set the properties of Allow Edit, Allow Additions, Allow Update, Data Entry to NO. However I want to allow users to be able to add new, edit/update and delete records from the form by clicking on respective command buttons.
the problem is that the code that I am using is giving me errors that says that I "You cannot go to the specified field" I need help on proper VB code to use that will allow me to enable input and update on the records in the table.
Private Sub cmdAdd_Click()
Me.Location_ID.Locked = False
Me.Location_Parent.Locked = False
Me.Zone.Locked = False
Me.Description.Locked = False
Me.Child12.Locked = False
DoCmd.GoToRecord , , acNewRec
End Sub
Dont know if that makes any sense, but I want to add a new record and i get errors
Neeeeeed some help ASAP....
View 5 Replies
View Related
Jul 23, 2015
I have a main form and 2 subform. The first subform has a field for %. And the 2nd subform has series of checkbox (Checklist or error made by the student)
Because every checkbox will lower the mark from 100 to x points per checkbox.So, I want that, if the field is not set to 100 yet, then they will not be able to check any box in the subform.I tried, before update of the subform, etc, but none work properly.
View 4 Replies
View Related
May 18, 2005
On the form for the Addresses I have a Combo Box for picking a Country.
When I hit the Delete button while the cursor is in the box I get a Message saying:
'You cannot assign the Null value to a Variable that is not a Variant data type'
The box has 2 columns, CountryName (Text) and CountryID (number), the second is the bound column.
I tried to Set the Warnings off, catch the error in the After Update Event, but
nothing helps to get rid of the Error Message.
Is there a way to Disable the Delete button, while in he box?
Or is there a better solution?
Thanks.
View 4 Replies
View Related
Sep 20, 2006
Hi Everyone,
I want to try to restrict the user not always changing the record, so i need a Disable combo box command. And i did try it by using "Name.Enabled = False" after user select the value from the combo box, but the program won't let me do that because of the record is on focus. So what can i do? I only have an idea of after the user select the value from cbo then jump the cursor immediately to the second column, but anybody can tell me how to do that?
Thanks alot!
Regard,
alex
View 14 Replies
View Related
Apr 13, 2005
I would like to have a combo box that doesn't show the drop-down arrow when the user selects it. You say, doesn't that defeat the purpose of the combo box?
Well, look. In a form I have a datasheet (in a subform) that only displays data, so it is locked from editing. Within the datasheet is a field that contains a combo box with a row source from a linked table, and the control source of that combo box is the primary key. Essentially I'm utilizing the combo box because it is smart, and allows me to display linked data: this combo box contains two columns, and I set the first column's width to "0" so that it would only display the field I want. I didn't use a subform because, in datasheet view, subform fields are not displayed in the linear fashion I need, but instead go hide under the "+" button for each record.
So, even though everything is locked from editing, the combo box arrow still appears when the user clicks on the combo box field, and I don't want it to. It's just misleading to the user. Anyone know how to disable the arrows? Or, if you catch my drift, do you know of another simple solution?
I'm not a keen programmer in case you couldn't figure that out. If you've got any VB tips then let me know.
View 7 Replies
View Related
Oct 18, 2006
I'm trying to disable users from right clicking, from within a combo box and selecting paste. The following code is suppose to work
Private Sub DESCREP_DESCRIPTION_GotFocus()
Application.CommandBars("Form View Control").Controls("Paste").Enabled = False
End Sub
but it doesn't work, any suggestions?
View 2 Replies
View Related
Sep 21, 2014
I have a form called frmSearch with an option group called grpSearch ,a combobox called comboNyaba and subform called subform_CasesSearch has a checkbox called CaseClosed
The combobox filter the subform based on option group choice and value in textbox called NyID ... it works fine except that if the combobox is empty it give me error the code in main form i put it on Load and on current
Code:
Private Sub Form_Load()
With Me.subform_CasesSearch.Form
If Me.grpSearch.Value = 1 Then
.Filter = "NyID = " & Me.ComboNyaba
[code]....
View 3 Replies
View Related
Aug 5, 2013
On a form, I want to disable the save button, 'cmdSave' whilst the form's mandatory fields have been left blank.
I've put in a smart tag, called, 'Req' against each required field and have used the following code on the forms current event.
Code:
Private Sub Form_Current()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType = acListBox Then
[Code] ....
The save button is disabled, but it won't enable again after each field has data entered against it.
I also have this code in the AfterUpdate event in each required field:
Code:
Private Sub cboErrorID_AfterUpdate()
Call Form_Current
End Sub
View 13 Replies
View Related
Jun 17, 2015
im trying to enable/disable checkboxes based on a combobox selection for instance,
i make the selection in a combo box called terms and conditions. i want it then to only enable the business,domestic and summary check boxes for that type, with the onther check boxes staying disabled. is there a way this can be done through code like the statement "only enable if this letter type selection has been selected"
View 14 Replies
View Related
Aug 4, 2006
Here's the deal:
I'm an extreme newbie, I do not know access very well, nor do I know VBA, I do know PHP.
I have a for in access that has 2 user input fields, one for prodid one for shipid. I have a combo box that upon entering data into the previous 2 fields, it does a query against an MsSQL database looking for a record that has both. In any case there will only be 2 outcomes, either 1 record, or null. I would like to have that same combo box automatically use the result as it's value so that users don't have to check the box, because they won't, and so that the rest of my VBA will be able to function properly.
Can anyone assist?
Thanks.
View 2 Replies
View Related
Jun 20, 2005
Hi All,
I have a combo box on my form that is retrieving its list of values from a table. After I choose a value I want to write it to another table's field. I can get this to work where it is writing to the other table's field, but when I open the form to see the field of where the information is supposed to be writen to it is not refreshing. What property on the combo box should I used to ensure that the field of the other table is instaneously updated when the combo box's value is chosen.
Thanks
Greg
View 3 Replies
View Related
Jul 12, 2005
Hey All
I have a following problem - the user selects value from a combo box (cmbPrio), if there was already a value in there, new value get added, and no further action is made.
If there was no value, value is added, AND in txtDueDate date gets added (if user selected High - todays date + 5 days, if low - todays date + 10 days)
I was thinking of doing it the following way, but it doesn't work --
Value XX is not saving the data. Should it be maybe done for a different event ? And I also don't get the correct date...
Before Update
If isNull(cmbPrio) then XX = 2
After Update
If XX = 2
If cmbPriory.text = "High" then txtDueDate = Now + 5
If cmbPriory.text = "Low" then txtDueDate = Now + 10
End If
View 3 Replies
View Related
Dec 9, 2006
I have a form that displays a list of users and there programs in a sub form, I would like a combo box instead of the user ID number so that I can press on it and all the user ID's will appear, then I can select it and there details will apear. Can this be done?
View 6 Replies
View Related
Apr 21, 2006
I said I was a dummy, but here goes.
I am designing a customer information form, the form has an unbound combo box showing customer names and when clicked opens the customer record.
My problem is when I enter a new record, I have a button that saves current and opens new, but when I am in the new record, the customer I just added previously is not showing up on the unbound control, only when I close the form completely and re-open it.
Is there a code to update the unbound combo box when you click to go to new record.
View 3 Replies
View Related
Jul 17, 2006
I want to update a field (field1) in each record of a recordset (qryUpdate)
I got the following code (in green) working fine - so far so good. I actually need to update the field from a selection from an unbound combo box. This looks up a table with two fields Period ID (autonumber PK) and a text field called Quarter. I've tried various combinations including the code in red and code such as
"rst![field1] = Me.cboPeriod"
"rst![field1] = Me.cboPeriod.Column(0).value" etc
but can't get it to work. It has to be something simple but I can't see it.
Private Sub cboPeriod_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryUpdate")
Do Until rst.EOF
If IsNull(rst![field1]) Then
rst.Edit
rst![field1] = 5
rst.Update
End If
rst.MoveNext
Loop
End Sub
Private Sub cboPeriod_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryUpdate")
Do Until rst.EOF
If IsNull(rst![field1]) Then
rst.Edit
[rst![field1] = Me.cboPeriod.Column(0)
rst.Update
End If
rst.MoveNext
Loop
End Sub
View 3 Replies
View Related
May 2, 2007
Hello again all... Today's problem is as follows.... I have an "after update" combo box that is coded as "CurrentDb.Execute "Uno", dbFailOnError". I have an update query which I am trying to have a combo box from a form input information, update a table with what the combo box was inputted with. (if you follow). In my query, I have one field as showing the "Update To:" filed as "Forms![Loc-1L]!Combo8". When I try to run the query, it works in the query if I manually type in a location, however when running it in the form, it gives me the error: "Too few parameters. Expected 1". Any ideas where I'm going wrong?
View 2 Replies
View Related
Sep 2, 2005
Hi,
Hope someone can help. What I’m trying to do is have a combo box look up values from one table and add them to another. I have used the combo box wizard to look up a value from table1 and add it to table2 but is there a way that it can lookup 2 values and add them to the second table. For instance if I had to tables like :-
Table1
First Name
Last Name
Table2
First Name
Last Name
Can a combo box lookup and update both fields for example if I have a combo looking up the first name can it also lookup the last name and add them to the corresponding fields in the second table but with the user only selecting the first name in the combo box.
I’m sorry if I don’t make much sense I’m new to access and fairly new to forums
Thanks for your help
View 1 Replies
View Related
Jul 27, 2006
i have a form that i want to stamp with a date when it was last updated. if a change to the form is made it will be stamped with today's date. i used the BeforeUpdate event so that you could choose to save the edits or not so if you didn't mean to edit a record then the date would not change. the code is:
Dim myVar As Byte
myVar = MsgBox("Changes to this issue have been made. Would you like to save the changes?", vbYesNo + vbQuestion, "Save Changes?")
If myVar = vbYes Then
[LastUpdate].Value = Date
Else
Me.Undo
End If
my problem is that when i change the combo box values it will run this event and ask to save. i think the reason this is happening is because the comboboxes save when you change them. how do i accomplish the same task as above but allow the combo boxes to act like txt boxes?
also is there a way that when i ask if the user wants to save or not, to have a cancel button that will take no action, leaving the record open the way it was (new typing and everything) before the user tried to close the form without saving that info?
View 14 Replies
View Related
Sep 26, 2006
ok i have three tables..
Booking_Table
Booking_ID
Job_Date
Company_ID
Booker
Passenger
Company_Table
Company_ID
Company_Name
Address
Phone_No
Company_Staff_Table
Company_Staff_ID
Company_ID
Full_Name
Phone_No
each booking will only ever involve one company at a time
company 'A' will have several staff
person 'A' from company 'A' may book a job for themselves
person 'A' from company 'A' may also book a job for person 'B' from company 'A'
i have created a booking form
i have added a combo list displaying all the company names..(control="comp_combo")
i have also added a combo list displaying all staff names from all companies (control="staff_combo")
when the user selects company 'A' from the first combo.. i would like the staff combo to update and only display staff members for that company
how do i do this.
View 1 Replies
View Related
Oct 18, 2006
This is so simple but I can't seem to make it work. I've poured through about 30 posts and tried all kinds of AfterUpdate event strings to no avail. Help!
Here is the simple setup. I have one table that lists employees and their corresponding teamleader. A grouped query provides the record source for a combo box. The idea here is that you select a teamleader from the combo box and a subform updates to show all the corresponding employees. This subform is based on a simple query of all fields on the table.
combo box = cboteamleader
mainform = frmTechMaintenance
subform = frmEmployees
I've finally settled on this...
Private Sub cboteamleader_AfterUpdate()
Me!frmEmployees.Requery
End Sub
...as having the greatest chance of success based on other posts. Not sure why it doesn't work. It just doesn't update.
View 6 Replies
View Related
Dec 6, 2004
i have several fields i would like automatically updating with data from a combo box.
at the moment i can only update one. the combo box relates to a query on one table,
the fields i want updating are on a second table. is this possible?
View 1 Replies
View Related
Jan 19, 2005
Hi,
I am trying to update a subform by selecting a record in a combo-box that corresponds to a particular test when i select the said test i want an adjacent subform to change to the form displaying the test data in the subform window i have tried to use VBA to achieve this but so far have been unsucessful does anybody know how this can be done?
Regards
Gavin Cleary
View 1 Replies
View Related
Apr 4, 2005
Good day all,
I have a problem when updating a combo box on a form. I open the form from a command button on another form (No problem) when I update the combo box on the new opened form Access acts like the record set is still opened. I tried closing the original form and even the table but I still get the same problem. If I open the form without going through the button the update works. Does anyone know hoe to correct this problem?
Thanks in advance.
View 1 Replies
View Related