Forms :: Force Value In Unbound Combo Box?
Mar 26, 2013
Ive got a database with a combo box, called "combo1" (with 2 columns). It is unbound but uses a query as its row source. When i select a value in combo1 is places the data from combo1.column(1) into a textbox (text1). I then click the next record button (button1) and it then keeps the same value in combo1 because it is unbound. So i need it that when i go to the next record it displays the value in combo1 that relates to text1.
View Replies
ADVERTISEMENT
Mar 2, 2015
I have a report that generates an in-house physical invoice for an event. On this report is a small section for a staff member to make hand written notes regarding when we call a week before the event as a final confirmation.
I want to have an empty check box in this section for the person to put a hand-written check. I tried creating an unbound check box in the report but it defaults to the gray fill of a null valued check box when printed.I tried setting it's default value in the report to 0 but for some reason I can't find a Default Value field among it's properties in the Property side bar. I did some research and thought that setting the Triple State value to No would solve this issue but it didn't.
How I can get rid of the gray fill when the report is printed? The field is completely unbound--this check box is purely for hand written notes, it has nothing to do with the database itself.
View 5 Replies
View Related
Oct 26, 2013
I have a form that I would like to have blank fields when it is opened. I put the following in the "On Open" Event field of the form properties:
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub
However, it does not work. I have an unbound combo box on the form for users to select from, in which all the records on the form will populate with whatever is selected in the unbound combo box. I thought this was the problem at first, but even if I remove that from the form, the form still opens to the first record. If I set the "Data Entry" field to "Yes" on the Data tab, that works, but then none of the fields populate when using the combo box.
View 3 Replies
View Related
Sep 17, 2013
I am using an unbound combo box to pre populate my field
Example: on my form if I select a post code prefix AB1 it is returning a value 2AB the second half field of the form.
The form works for me however it does not return any value for the second half on my table.
View 1 Replies
View Related
Jun 16, 2014
I have added a combobox to one of the forms in my customer database using the "find a record in my form based on a value in my combobox" section of the combobox wizard.I have a number of columns in the combobox (the primary key is the bound value, and I have unbound columns for first name, surname etc).
I sorted the records in the combobox by column 3 (surname) so I can scroll through the list and choose surname instead of having to memorise customer numbers. Now I have more than 1500 records (with more on the way), scrolling through takes ages, and I was wondering if there is a way to adapt the combobox so I can (for example) type the first letter of a surname into the box and be taken to surnames beginning with that letter, whilst retaining the primary key as my bound column?
My initial thought was to base the combobox values on a query, and make the query prompt for a starting letter (or string of letters) each time it runs, so it only displays the query results in the list, but I was wondering if there is a neater way to do it?
View 2 Replies
View Related
Jul 18, 2014
I have form with an unbound combo box which is populated from a query
It should populate a field in a table which is related to another - however it only works when i query by id number (primary key) and not the text value i want - is it possible to query both so it returns say 1,option 1 - then when selected it will place a 1 in the table - which is related to option 1 in another table instead of just having to select '1' which will mean nothing to a user?
View 5 Replies
View Related
May 28, 2013
How to change a combo box to a text box control in a subform for a field that is based on a two-column value list. I want to be able show the value in the unbound column (which is a text value instead of a number).
My subform has a field called "ProjectStatus". This field is a value list in my projects table with the following row source:
1;"Built";2;"Unbuilt";3;"Active";4;"On Hold";5;"Completed (Master Plan)";0
So, it is set as a two-column value list with a number data type for the bound column. In my forms, column 1 is made invisible (set to 0") so that only the text value is shown to the user. This works fine with combo boxes.
However, I want to change the unsightly combo box to a text box and show the text value of the unbound column (this form will only be used to show data not for entry). When I change it to a text box control, the value that appears is a number, of course.
If ProjectStatus were based on a table, rather than a lookup value list, I would query it but I am not sure how it should be done with a value list. I could just store the text value instead, I guess, and redo a bunch of stuff or I could create a "Status" table and redo a bunch of stuff (this seems like my lot in life lately) but I feel like there should be some way to do this.
View 6 Replies
View Related
Oct 2, 2013
I have an unbound combo box that looks up a list of numbers through a query but on the drop down list it does not go all the way down to the bottom of the numbers. For instance the combo box will only go down to the number 27453 but I know there are more numbers than that in the table. I can even type in a number and get the info but it still doesn't show up in the list...
View 1 Replies
View Related
Mar 11, 2014
I have about 4 combo boxes with a list value of dates in them, combo1 is the 'main control'. When a date from combo1 is chosen and a button is clicked, the other 3 combo boxes receive a default value that closely matches combo1. In fact the default value each of the 3 combo boxes receive exists in that combo box. For example, if I gave combo2 default value "2013/01/01", it actually has that date in its list. What I want to do is trigger a OnChange even after combo2,3,4 receive their values. Other things happen after the OnChage trigger is fired.
View 2 Replies
View Related
Jun 26, 2014
I have a textbox (Odour), that contains one of four words (Cadaver ( ), Drugs ( ), Explosives ( ) or Money ( ) ), the word is written in by pressing one of four buttons, this works fine.
I now want the user to write in between the the brackets and only the brackets. For example:
The textbox contains Cadaver ( ), I want the user to be able to write between the brackets "Blood".
I seem to recall that there is a way of only allowing the user to type in certain places within a textbox.
View 2 Replies
View Related
Aug 4, 2015
My database is tracking Job/Project information. The users must assign the Job Contacts which can be both internal and external (ie: Contracts is a Client Contact, while Engineer is an Internal position)..
tblContactTypes which defines each of the 10 types of job contacts.
fldTypeID: fldTitle fldClient fldInternal
1 Contracts True False
2 Engineer False True
3 Other True True
The Job Specific data is stored in tblJob_Contacts
fldJobID (PrimaryKey)
fldTypeID (from tblContactTypes)
fldEEID for Internal Contacts (from tblEE)
fldContactID for External Contacts (from tblClientContacts)
My question is this...How can I force the user to enter the Contact information for Contact Types 1,2,3, and 4 while leaving the remaining contacts types as optional?
I would like a form with combo boxes for the first four Contact Types which must be assigned for every job and then a continuous subform where the user can assign the remaining contact types if needed.
Initially, I planned to store the first four Contact Types as separate fields in the main table (tblJob) - however, distribution lists are needed and it makes more sense for all the contact information to be stored in the same table.
View 2 Replies
View Related
Jul 13, 2014
I have the following tables:
Supplier
Supplier# [Other columns]
Material
Supplier# Material# [Other columns]
DeliveryHeader
Delivery# Supplier# [Other columns]
DeliveryDetail
Delivery# Supplier# Material# [Other columns]
I've created a form based on table DeliveryHeader with a subform based on table DeliveryDetail. The two are linked by Delivery# Supplier#.
On the form, Supplier# is a combobox that lists all suppliers from table Supplier.
On the subform, Material# is a combobox that lists only the materials supplied by the supplier selected with form's Supplier#.
The problem is that this second list always shows the materials of the first listed supplier. For instance, when the form is loaded, it shows delivery #1 with all its details on the subform. Suppose supplier loaded to form is #1.
1) If I use subform combobox, it shows correctly supplier's #1 materials. But then, whatever delivery I navigate, it always shows supplier's #1 materials.
2) If I navigate to another delivery without using subform combobox, suppose I stop on a delivery where the supplier is #4, then subform combobox shows correctly supplier's #4 materials. But then, once again, whatever delivery I navigate, it always shows supplier's #4 materials.
I've spread Me.Requery here and there but without any success. What trick must I apply to force the execution of the query of the subform combobox Material# each time I navigate to a new record on the form?
View 4 Replies
View Related
Aug 1, 2013
How can I force a field in a form to be updated before the record is saved / changed?
For instance I have a form with information on it and I want to ensure that any time the form is updated the user fills in a section providing the date and by who it has been updated by. I dont want the record to save unless that information has been filled out, and I also want it to take you to the field if you press save and it hasnt been filled out along with an error message.
To try and be a bit clearer. At current I have a Save and New button. This saves the form if dirty and opens a new record.
I want to add in the step that if record has been changed and FieldA has not just been updated then go to fieldA (Showing a message box). If FieldA has just been updated then save record and open new as normal.
My current save & new button properties are as follows (in Macro Editor)
On error Go To Next
If [form].[dirty]
RunMenuCommand Command SaveRecord
End If
If [MacroError].[Number}< >0
Message =[MacroError].[Description]
Beep Yes
Type None
Stop macro
On Error
Go To Fail
Go To Record
Record New
Go To Control
Control name Resort Code
View 3 Replies
View Related
May 2, 2014
Is there any way to force a field value to be unique and of a set length, but with exceptions?
Let me explain... I have a text field in my table called "employee_number" and this value is always one of the following:
NULL
an 8-digit number
the word "External"
What I want to do is to force that field to either be NULL, the word "External", or a unique 8-digit number.
Is this possible? Obviously I can't set the source field in SQL to accept unique values only but I wondered if there was any way around it at form level?
View 8 Replies
View Related
Aug 29, 2006
Hello all
I'm new to Access so sorry if this is stupid - I have looked everywhere!
I have an unbound combo box on a form that is populated in the onload event of the form by setting the rowsource to a query based on the companyID on the form. The query gets me a list of contacts at that company.
So, after the form is loaded the combo box (if dropped down) might show:
1 Fred Smith
7 Jim Jones
9 Arthur Askey
The first column contains the ContactID.
My question is .... when the form loads I know the ContactID of the person I am looking at. If that person is 'Jim Jones' and I have a field on the form which contains Jim Jones ContactID of 7 - how can I get the combo box to be showing the 'Jim Jones' row?
(I don't what to bind the combo box to anything as I want to use it just to filter which contact I am looking at - not change the ContactID)
I guess I want to loop through the combo box saying 'If the contactID of this row = the ContactID on the form - select this row' - but I can't find the syntax anywhere.
Thanks for any help.
View 4 Replies
View Related
Mar 30, 2006
i really need some help with this... heres the background. I have an unbound search combo box in the header of my form. when users select the PCNo from this combo box, i need the associated container no to appear in a control on a bound form.. below are my tables:
tblShipping
ShipID (PK)
PCNo
tblContainer
ContainerID(PK)
ShipID (FK)
ContainerNo - (data to be displayed on form)
how can i pull up and display the container no (stored in tblContainer) based on the PC No that a user selects from this combo box?
i have got the combobox working fine - the users can select a PC No that is already stored. what i need now is for the Container No to be displayed on this form, based on the PC No.
View 1 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 25, 2013
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.
View 3 Replies
View Related
Mar 19, 2006
Ive got a combo box linked to fields in a form so when I value (tenantID) i selected in the combo box the record appears in the form.
The problem is, I have changed the form name Unbound (it was blank) to TenantID as I want it to appear when the form is opened, however now I cannot select other items from the combo box.
Help !! xx
View 1 Replies
View Related
Sep 15, 2004
It wont populate the pertinent fields.. where have I gone wrong. DB attached.
View 8 Replies
View Related
Feb 19, 2014
I have an unbound combo box on a report that looks up to a table of address data.I have a specific requirement where if one of the bound fields on the report is a specific value, I want the combo box to show data. If the bound control on the report is a different value, I want the data in the combo box to be different.
I have tried using the OnOpen method, but it says I cannot assign a value to it.I have tried using the OnLoad procedure, but it doesn't show anything. the code is as follows:
Code:
Private Sub Report_Load(Cancel As Integer)
If Me.[Dispatch Type] = "Sent to A" Then
Me.cboDispatchTo = 15
ElseIf Me.[Dispatch Type] = "Sent to B" Then
Me.cboDispatchTo = 8
End If
End Sub
View 1 Replies
View Related
Apr 5, 2005
First, just want to say I wish I had found this site a long time ago. Lots of good stuff here :) I don't know a lot about Access, but know it can be a great tool for what I need. So I hope I can find the help I am looking for...
Ok, on my form I have three unbound combobox's that I use to filter the information I want. The first two do not need to be used, meaning that the third combobox will show all the records if the first two are left blank.
With that being said...
I would like the form to show no data until the selection is made in this third combobox. SO, my first question is how do I make the form show no records till this combobox has a selection. And second (at the same time), make that third unbound combobox with the selection load that record to the form fields so they can be viewed or edited??
I'm sure it can be done, but I am lost...
Hope I explained it ok :)
Thanks in advance!!!!!!
View 1 Replies
View Related
Sep 15, 2005
Ok sorry to be a pain :D
I have a main form frmProperty from where you can go via a button to frmTraining and these two are linked by "Property Code".
On frmTraining i have an unbound combobox which gets it data from the tblTraining table. I want this to only display data for the "Property Code" that the frmProperty is pointing to.
I assumed this would just work if the link criteria was present in the button code, however it appears that no matter what the "Property Code" the combo box displays all the data in the tblTraining table.
Anybody have any ideas?
Many thanks
View 1 Replies
View Related
Oct 14, 2005
HI THERE. IM HAVING A FEW PROBLEMS TRYING SORT THIS PROBLEM OUT. I HAVE A DATABASE IM TRYING TO APPLY A FILTER ON THROUGH AN UNBOUND COMBO BOX. WHEN SELECTING THE DROP DOWN FILTER TO SORT THE RECORDS NOTHING HAPPENS. THE CODE IM USING IS
Private Sub Combo??_AfterUpdate ()
'Find the record that matches the the control
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[WARD_AREA] = '" & Me! [Combo??] & " ' "
If Not rs.EOF Then.Bookmark = rs.Bookmark
End Sub
Does anyone know why this filter is not sorting through the records. Any comments much appreciated!!
Attached is the database
View 1 Replies
View Related
Oct 29, 2005
Hi folks,
I have a form with a record source property set to a query which pulls the data by joining two tables. The form also has four navigation buttons (first, previous, next, last) and a ADD record, SAVE record, EDIT record, DELETE record buttons.
I also have a unbound combo box (control source iset to 'empty') in the form's header section and its record source property set to an SQL (SELECT DISTINCTROW tblProjts1.chrProjectName, tblProjts1.intProjectID FROM tblProjts1 ORDER BY tblProjts1.chrProjectName;). It's columns count is 2, bound column is set to 2 and column width is set to 3.1146";0".
In the edit button, I have the code "Me.AllowEdits = True" so that the user can edit the data.
Also, I have the following code on form's "on current" and "after update" events so that it will flip back to allow edit to 'NO'
Me.AllowEdits = False
Also, I have the following code on the combo box's 'after update' event.
Dim strSearch As String
strSearch = "[intProjectID] = " & Me![cboProjectID]
'Find the record that matches the control
Me.Requery
Me.RecordsetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark.
My Problem:
When I run the form and select a record from a combo box it populates the fields (all memo data type) in the form with correct linked record, ONLY when my allow edit property is set to 'YES'.
With allow edit set to 'NO', then when a tried to make a selection from a combo box it doesn't allow me to select any record. The combo box seems to be locked up and I can't select any record.
Does anyone come across such a problem with cbo box and 'allow edits' property in the forms.
Your help is much appreciated.
ShanVel
View 2 Replies
View Related
Jan 27, 2006
I'm pretty hopless with VB but I am trying very hard (hours spent on this forum reading code I only slightly get the gist of) to implement a form that takes input from two synchronised unbound combo boxes and then displays records matching the input in a sub-form in datasheet mode. I'm failing at the first part just now: the combo boxes. No doubt I'll fail at the second part too but I'll deal with that when I get this fixed. :)
I was using the northwind DB to learn how to synchronise the combo boxes. I successfully did it by following the instructions and using this code from MS kb article 209595 in the After Update procedure:
Me.Products.RowSource = "SELECT ProductName FROM" & _
" Products WHERE CategoryID = " & Me.Categories & _
" ORDER BY ProductName"
Me.Products = Me.Products.ItemData(0)
I then tried to implement this on my database by changing the relevant information to reflect my database info. as shown below, and it does not work. I switched Product references for my Unit references and Category references for my Item references but I don't think I got it right or over-simplified it due to the table structure.
Private Sub Item_AfterUpdate()
Me.Units.RowSource = "SELECT Unit FROM" & _
" Units WHERE ItemID = " & Me.Items & _
" ORDER BY Unit"
Me.Units = Me.Units.ItemData(0)
End Sub
When I compile the code it stops at Me.Items with the error "Method or data member not found". So I assume that I have not referenced the right objects when I modified the code. I thought this was maybe due to the two tables I'm using being in a many-to-many relationship via a junction table, as opposed to the northwind tables which are directly linked by a one-to-many relationship. If this is indeed the case, can anyone help me put this right. I have attached my table structure / relationships in a .jpg to this post.
Any help from all you smart developer dudes would be muchly appreciated.
View 11 Replies
View Related