Problems Referring To Combo Box For Default Value In Subform
Nov 30, 2006
I want my subform to allow additions. I would like the default value for one of the fields in the subform to be the value chosen in the combo box that is used to select which records are shown in the subform. The row source for the combo box is
SELECT tblLicensee.LicenseeID, tblLicensee.[Licens#] FROM tblLicensee;
where LicenseeID is the key field and Licens# is what is displayed.
If I refer to the combo box for the default value for that control on the form…
=[Forms]![frmFindRecord]![Combo37]
the key value (LicenseeID) is entered as the default instead of the value displayed in the combo box (Licens#). How can I set the default value to record the Licens# instead?
View Replies
ADVERTISEMENT
Jul 21, 2014
I have a form named frmMain that contains five buttons that lead to subforms, one of which is named frmDeceased.
In frmDeceased, I needed to create a combo box that relied on selections from the combo box before it. I was able to do this successfully in frmDeceased, but then today when I opened the database and opened frmMain, I realized that the query fails when frmDeceased is opened via frmMain. It works perfectly if I just open frmDeceased directly.
The first combo box is ROHE and the second is Iwi (which is dependent on the Rohe selected).
The query for Iwi has this criteria: Forms!frmDeceased!cbo_ROHE
When I open frmDeceased through frmMain, I get the 'enter parameter value' message showing "Forms!frmDeceased!cbo_ROHE".
I tried changing this query to: Forms!frmMain!frmDeceased!cbo_ROHE, but it didn't work.
View 14 Replies
View Related
Jul 3, 2006
Just a quick question, I can't seem to get this right (as usual :confused: )
I have a form and I want the label in the header to display the text from a field in a related subform. I have tried the following syntax to no avail:
=[Forms]![sfrmCompanyName]![LastName]
Any suggestions
Thanks in advance
Nicolas
View 2 Replies
View Related
Nov 15, 2004
I know how to refer to a control on a form by using [forms]![formname]![controlname], but can anyone help with referring to a subform.
I have a subform called subPrograms, on which is a combo box whose contents need to be filtered depending on the selection from another combo box on the main form.
The combo box on the main form is cboDivisions.
The combo box on the subform is cboPurchasers
Main form is called frmMain
Subform is called subPrograms
The user is supposed to select a Division, and then depending on that selection the contents of cboPurchasers will change to only show those that are within that same division.
I would also like to know how to update the cboPurchasers when the cboDivision has been selected? Can someon help?
I hope that this is enough info.
View 2 Replies
View Related
Jan 26, 2006
Hello, I am using an IIF statement in my SQL criteria, and was wondering "if" it was still possible to reference a column within a combo box... here is one iif statement
Like IIf(IsNull([Forms]![fSampleSearch]![cboCustomerName]),"*",[Forms]![fSampleSearch]![cboCustomerName])
I want to refer to the third column of cboCustomerName... How would I do this ?
View 8 Replies
View Related
Mar 3, 2015
I have a form with a subform that has a table on it. The subform table is a price list with the fields Description, Details (which is hidden as it's too big for the table) and Price.
I want to be able to double-click on a chosen item from the table to display a pop-up showing the same details but with the Details field shown. I have the pop-up in place but I am struggling with displaying the chosen information.
How do I reference the fields on the chosen line in the table?
View 6 Replies
View Related
Mar 5, 2013
I have an Access 2010 application and I'm having trouble referring to properties in my subform withon a Navigation form. Based on a selection in a Combo Box, I need to change the filter on the subform. The relevant forms are:
Main Navigation Form = frmAdminNav
"Standard" Navigation Subform = NavigationSubForm
My Subform = frmShowInventory
How do I refer to the Filter property on frmShowInventory?
View 2 Replies
View Related
Aug 14, 2014
I have a form with a subform which resides in a tabbed control. In that subform, I have a textbox in the footer that sums values in the detail section of the subform.
I have a textbox on my main form that should display the same data that is in my subform footer textbox, but it is giving me the #name? error.
This is the expression in my subform footer textbox (which returns the correct result):
TxtSubtotalHQPCalc -
=Sum([ActualHQPCalc])
And the expression in my main form textbox (which returns #name?):
txtActualHQPValue -
=([subfrmHQPProject].[Form]![TxtSubtotalHQPCalc])
I have verified that my subform name and textbox names are all accurate. This is very frustrating because I am using this exact same method in a different database with no problems!
View 3 Replies
View Related
Feb 22, 2013
I believe I did this before awhile ago but for some reason I keep getting an error.
I have a Mainform (frmMain) that has a Subform (frmSub). On frmSub I have 2 comboxes (strCom1 & strCom2) one is set to invisible (strCom2.Visible = No).
So using the "On Open Event" of frmMain I want make strCom2 visible if strCom1 = "Read Only". Ofcourse I will also need to place the vba on the On After Update event. Below is what I have so far but doesnt work.
I get Run-time Error 2427 "You enetered an experssion that has no value"
Code:
Private Sub Form_Open(Cancel As Integer)
If Me!frmSub.Form!strCom1.Value = "Read Only" Then
Me!frmSub.Form!strCom2.Visible = True
Else
Me!frmSub.Form!strCom2.Visible = False
End If
End Sub
View 5 Replies
View Related
May 6, 2014
I have a subform containing a list of Funds and attributes such as Asset Type, Fund Manager, etc.
Currently, I have a textbox, where the the control source is set so that it will be updated with the Asset Type from the subform.
I also have an unbound combo box that contains a list of Asset Types queried from a table via row source, where user can select the Asset Type.
What I would like is when a record is selected from the subform, the Asset Type is selected on the combo box as a default value. User can select another Asset Type if required. How can I do this?
View 1 Replies
View Related
Apr 17, 2013
Go to frmInvoice, and you'll see a Net Total box (txtNetTotal) . It's control source is linked to a textbox in the subform fsubInvoiceDetails2 called txtStocktotal. It basically just pulls up all the costs associated with that InvoiceID.
The reference mechanism is as follows: =[fsubInvoiceDetails2].[Form]![txtStockTotal].Now...sometimes this works and sometimes it doesn't! Sometimes i've had to use: =forms!fsubInvoiceDetails2!txtStockTotal.
It seems to be very temperamental at times and i'm not fully confident if this can be explained.By way of note, I use express builder normally to input these statements: I go to Forms > ALL FORMS > fsubInvoiceDetails2 > txtstocktotal.
View 2 Replies
View Related
Feb 13, 2006
Hi Everyone,
I hope someone can help.
I have a form with a combo boxes and a table with relevant list and additional field, fldDefaultDrive (Yes/No Field).
Currently in order to set the default value, I have used the following code for each default;
Private Sub Form_Load()
Forms!frmMediaLabeller!CboDriveName.DefaultValue = """D"""
End Sub
However, I want users to be able to go into the table and change the default value if thier CD player default Drive is anything but D: Drive. I have tried to replace the D above with an SQL statement but with no success.
Private Sub Form_Load()
Dim Drivename As String
Drivename = SELECT tblMediaDrive.fldDrivename FROM tblMediaDrive WHERE (((tblMediaDrive.fldDefaultDrive)=-1));
Forms!frmMediaLabeller!CboDriveName.DefaultValue = """Drivename"""
End Sub
This is definetly not working, can anybody help, I have a feeling it is syntax but not sure where? :confused:
Robert88
View 7 Replies
View Related
Mar 10, 2005
Scenario: I have a combo box in an evaluation db that is set up to return 3 columns - EmpID, Name, JobID. The combo box only shows Name, but properly updates the neccessary fields on the screen.
Problem: I would like to turn the JobID txt box into a combo box that would default to null prior to a Name selection (on a new record) and then default to the recorded JobID after Name selection. 99.9% of the time, this won't be used, but occasionally an employee will receive an evaluation for a JobID they did, but were not officailly assigned.
The right way to do it would be to create a second record in the primary system that I am polling the data from, but that is not feasible given the nature of that system.
Any ideas?
-Brian.
View 1 Replies
View Related
Apr 11, 2007
can anyone tell me how i can have the default value of the combo box field as the first value in the combo box drop down list?
View 3 Replies
View Related
Jul 20, 2005
Hi guys,
I'm obviously doing something stupid in my form :-) If you open the form in the attached sample you will see that I have 2 combo boxes. One of them has a default value showing and the other doesnt, I want to get the second combo to automatically show the value in the list but just cant seem to get this to work...
I cant work out whats different bewteen the two. Been tearing my hair out here so would appreciate some input.
Thanks in advance
View 10 Replies
View Related
Sep 19, 2005
Hi guys,
In my form I have a combo box that is bound to a product/specification table.
When clicked, this combo box displays a list of products, each with its respective set of specifications (although I configured it so just the product column can be seen.) The reason I do this, is so that the specification values (against which certain other values in the form is critiqued) will be a static value in the form itself, and not a changeable value in a table.
What I want to do, however, is to let the combo box assume a default value when the form load (it must already have a product selected at start-up.)
How can I do this?
Thanks ahead!
View 4 Replies
View Related
Jan 26, 2006
Hi all,
Can some one help me with how to set a default text on a combo box whose record source is set to a query?
I have a form with two combo boxes. The first combo box’s record source is set to the following query:
SELECT chrCategoryID, chrCategoryName
FROM tblGuarCategory;
My 2nd combo box will list all the items based the category I select on the first combo box.
But when the user opens the form, instead of showing both combo boxes blank, I would like to display the following text:
Combo Box1: Select a category
Combo Box2: Select an item…
I tried to use the combo box’s Default Value property like = “Select a category”. It didn’t work. I am not sure what is missing here. I appreciate your help.
View 4 Replies
View Related
Dec 14, 2006
I am sure this is a very basic problem but I just can't seem to make it work...
I have a form with a combo box. The values for the combo come from a table listing available month and year of various data. When the vlaue is selected in the combo box, the form refreshes the data to display that month and updates another table with that month that is used for a few different functions. Everything works great except that when you open the form, there is no value displayed in the combo box. What I would like for it to do is display the month that is equal to the value found in the second table, since that is considered to be the current month. I have tried various approaches to setting the default value and using a query in the control source but It still shows no value when opened. Any advice would be appreciated....
View 2 Replies
View Related
Apr 28, 2006
Hello,
I have a form with a combobox which has its record source to a table which has 5 records.
Is it possible to open the form so that by default the combo shows a specific record?
I have tried something like this but does not work:
On Open event
Me.Cbo = "ID"
ID is the record I need to show.
Thanks.
View 1 Replies
View Related
May 4, 2005
This may be more a VBA question than a forms question.
I have a main form and a subform. The suform contains several fields and there are several records on it for any given record on the main form.
I also have a command button on the main form that creates a new record. I would like to have the default records to disply be based on the values from the previous subform.
I don't know if that is clear. An example the main form would contain a location and date and the subform would have sales figures for Tom, Jane and George for items a, b, and c. Tom, Jane and George would be records and a, b and c would be fields.
Generally a weeks worth of data would be entered and generally new values would be added for the same group of records from one day to the next for any given week, however, there might be times when more or less records were entered.
I would like to set it up so that the subform is populated with the same records as are in the subform before the command button is pressed to create a new record on the main form. For instance if on day one items sold are entered for Tom and Jane when a new record is created it would display Tom and Jane on the subform with blank values for items sold.
I thought I could use min or max to get a default value, but, the table that the values go into is by date so max might get the value for Tom but not Jane and George (I think).
Any Ideas?
Thanks
View 1 Replies
View Related
Jul 10, 2005
:confused: I was wondering if somebody can help with my default combo box problem?
I have a secured database whereby users logon, which is used as a scratch pad for keeping track of Purchase orders. A Form frmUserInput with two relevant fields for this problem 1. User Initials txtUsersInitials and 2. POBook (Purchase Order Book) which is the combo box cboPOBooks both unbound fields on the form.
The txtUsersInitials is generated automaitcally when the form is loaded using a VBA statement txtUsersInitials = Current User.
The list of the combo box is generated from a table tbleUsersPOBook and uses a query qryUsersDefaultPOBook as listed below;
SELECT tblUsersPOBook.UsersPOBookName
FROM tblUsersPOBook
WHERE (((tblUsersPOBook.UserName)=[Forms]![frmUserInput]![txtUsersInitials]));
This generates a drop box showing the Different department codes for each individual. So for some it is only one item for others up to three codes, this part works fine... :)
:cool: However here is my problem.
Since some people can sign off more than one Purchase Order book I have had to add an additional field in the table tblUsersPOBook called DefaultUsersPOBook which is a yes/no field, so only one yes exists for each user who logs on. I have created another query qryDefaultPOBook as listed below;
SELECT tblUsersPOBook.UsersPOBookName
FROM tblUsersPOBook
WHERE (((tblUsersPOBook.UserName)=[FORMS]![frmInputForm]![txtUsersInitials]) AND ((tblUsersPOBook.UsersPOBookDefault)=Yes));
When I place this query in the Default section of the combo box it gives me no result.
Firstly is it possible to have a varying default like this since each user will have a different default?
Or is there maybe a better way of achieving a default which is variable for each user based on thier default Purchase order book in the table tblUsersPOBook for the field "Yes" in DefaultUsersPOBook ? :confused:
View 8 Replies
View Related
Sep 26, 2005
I am trying to set the result of a query as the default value for a text or combo box. I have tried setting the query as the default value in the box's property. I have also tried doing it in VB. The code looks like this
Dim SQL AS String
SQL = "SELECT Address
FROM Table1
WHERE Name = Forms!Main_frm!name_lbx.Value;"
Forms!Address_frm!address_cbx.DefaultValue = SQL
I have also tried
Dim SQL AS String
SQL = DoCmd.OpenQuery([update address_qry])
Forms!Address_frm!address_cbx.Value = SQL
Where update address_qry is the same as the above.
I keep both forms. I know how to do it by setting the queries as values in a list box, then transfering the values to the text or combo boxes. But I was hoping there was an easier way.
Thanks
Alex
View 1 Replies
View Related
Sep 26, 2005
I am trying to set the result of a query as the default value for a text or combo box. I have tried setting the query as the default value in the box's property. I have also tried doing it in VB. The code looks like this
Dim SQL AS String
SQL = "SELECT Address
FROM Table1
WHERE Name = Forms!Main_frm!name_lbx.Value;"
Forms!Address_frm!address_cbx.DefaultValue = SQL
I have also tried
Dim SQL AS String
SQL = DoCmd.OpenQuery([update address_qry])
Forms!Address_frm!address_cbx.Value = SQL
Where update address_qry is the same as the above.
I keep both forms open. I know how to do it by setting the queries as values in a list box, then transfering the values to the text or combo boxes. But I was hoping there was an easier way.
Thanks
Alex
View 2 Replies
View Related
Jun 14, 2006
I used a combo box to let user select "Proejct Status" such as active, completed, cancled. I want to set active as a default selection if user does not choose other status. How can I do that? Thank you very much for your help.
View 2 Replies
View Related
Nov 5, 2006
Hi all,
New to the board and access (2000)
I have been tasked w/ creating a database to schedule and track incoming cases for my job (Dental Lab)
This entire thing is new to me but have developed most of it through reading this forum so thanks for that!
I still have a long way to go...
Here is what I am stuck on -
I have a table of technicians
here you can add the first name, last name, and department (The department is coming from another table called department)
These are working fine,
Now I have a table for the doctors to fill out a form to initiate a new case,
In this table I have a field called techassigned1 which pulls from a query of the technician table where the deptmant is set to plaster bench.
This works fine - I get a dropdown box with the technicians name that is assigned to the plaster bench (This name changes periodically)
But All I want is for that 1 name to be set as a default value - I need it in the table so I know who started the work on the case
I dont want the doctor to have to choose this name
I read in the forum and used
Me!techassign1.DefaultValue = Me!techassign1.ItemData(0)
in the forms ONOpen event
But this is what happens
The form just displays #Name? in the dropdown box but the correct name is under it if I click the arrow
But if I right click and look at the property sheet the name is in the default value property but it still doesnt update the techassign1 field in the table.
Is there a way to have this automatically add the technician from the query to the table? without haveing to select it?
Any help is greatly appreciated -
If I am not making sense plese let me know and I will try to explain it better.
View 7 Replies
View Related
Nov 30, 2005
Hi all...I have a combo drop down box that has the 50 states in it. I would like the list to pop to the first state that starts with a letter typed in. For exampe, you type 'C', takes you right to CA.
Anyone now how to do this? (silly question )
View 2 Replies
View Related