Insert Relevant Value Based On Selection
Jun 15, 2005
I have a form with a combo box this combo box looks up values in my STC table. The STC table has two fields STC & Resolver and each STC has a unique associated Resolver. What i want to happen is after the user has selected the STC from the combo box on the form the associated Resolver be displayed in a textbox on the form. I am ussing the following code but nothing seems to be happening:
Private Sub cboSTC_AfterUpdate()
Dim ResolverSource As String
ResolverSource = "SELECT tblSTC.[Resolver] " & _
"FROM tblSTC " & _
"WHERE tblSTC.[STC]='" & Me.cboSTC.Value & "';"
Me.txtResolver.RowSource = AgentSource
Me.txtResolver.Requery
End Sub
View Replies
ADVERTISEMENT
Apr 6, 2006
Hey guys, I'm not sure if this is possible, and it is the most challenging thing that I have tried to implement into my database to date.
What I have is a booking form which allows you to Add Bookings for camera kits.
When a customer comes in and would like to book a kit, the form must be filled in with the relevant details, I have 2 combo boxes on this form.
The first is the Kit selection, there are 5 camera kits.
The second is an option to book the full kit out, or just components.
So here's the tricky part...
When the first combo box selection is made (eg. Kit 3) I need the Kit3 table to be active.
Then, when the user selects "Components" from the second combo box, I need a form to open up based on both of the above.
So a form based on tblKit3 would be opened and the user can manually select the components that they require to be booked out.
Any help at all would be appreciated.
View 1 Replies
View Related
Mar 23, 2008
This is probably in the wrong forum, but I'm not sure what area the answer would cover, either queries, macros, VBA etc.
I have a form, on which is a listbox with multiple selection enabled getting it's data from a query. What I want to do is for the user to be able to select multiple products from the listbox and have some VBA code or query concatenate each id and insert them into a table, separated by commas so I can separate them again for reports etc.
Eg.
Listbox:
ID
1
2
3
User selects 1 and 2 and clicks submit. Selections are concatenated to 1,2 and inserted into the table.
Please bear in mind I'm not the best at this kind of advanced databasing, so a simple or at least easy to follow answer would be very appreciated.
Thank you all in advance.
Steve
View 8 Replies
View Related
Aug 7, 2005
thank you in advance for all your BIG help. :)
I have 3 tables - SMaster, SI_map, ILookup
I need to create a form to Add/Update into SMaster and SI_map tables, which has one-to-many relationship, that's why I use a list box to show the values from SI_map.
in SMaster [ Sid, other fields ]
in SI_map [ primary key, Sid, ILookupid ]
in ILookup [ ILookupid, IName ]
questions:
1. How to get the multi-selected values from the list box?
2. insert these multiple records into SI_map table at the same time with SMaster (if I use the same form to populate all these fields)
3. how to populate the records into form for user to see and update the values?
Any suggestion is appreciated, it is very flexible to change any format such as SMaster and SI_map can be separate forms, as long as it works.
Thank you.
View 3 Replies
View Related
May 20, 2013
I want to insert obtain marks of the subjects. Find the attached my db. when i select combo value my requirement is to insert the all records which associate with the combo. but when i select combo value it will happen nothing.
View 7 Replies
View Related
Jun 20, 2005
I have a form that contains a list box with 11 separate options. Within this list is the option named "None". My desire is to have a message box displayed when any option is selected other than "None". I have searched various threads, however I have been unsucessful nailing down my issue. Thanks in advance for the assistance.
View 1 Replies
View Related
Feb 3, 2006
Is there a way to take a form, select the fields that you want to display on a template(I created the template)? Then the fields that aren't selected grey/disable them? In other words. We perform several tests, ie. test 2006.01 and 2006.02 etc. Each test is based on 1 table. So instead of having to go in each time a new test is needed, can I create a form that has selectable fields(checkboxes), and once I say ok it opens the "new" template it will have the fields that need to be on that test then grey out the ones that aren't going to be used this time around? Sort of new to this....
View 2 Replies
View Related
Sep 28, 2004
I am learning Access fairly quick, but still a newbie and stuck on an autofill problem. I have read everything I could find and it seems there may be code involved, which I'm not sure about.
The problem seems simple enough: I want to populate field "Rate" in the table "Services" based on the selection from a dropdown menu referencing ClientID in the Clients table. Specifically, my form uses a drop down menu to select ClientID for the Client table to associate with fields in the Project table and I have imbedded another form at the bottom which contains fields from the Services table including the Rate field I want autofilled based on the ClientID selection. Here are the tables and fields I'm working with...
...table...
Client
...fields...
ClientID (PK)
Rate
<and more>
...table...
Project
...fields...
ProjectID (PK)
ClientID
<and more>
...table...
Services
...fields...
ServicesID (PK)
ProjectID
Rate
<and more>
Please be easy on me if this is a simple problem. Thanks!!!
View 7 Replies
View Related
Jul 16, 2013
I am currently re-vamping our IT Database and designing a new form for our Hardware but want to make look a bit fancy but struggling.
I want to have a picture based on a Model of a Computer/Laptop being pulled in from one of my Tables but finding it hard to make is possible.
The 'Model' field is looking a field in table 'Inventory' which is a 'Lookup & Relationship' to table 'Model'
View 5 Replies
View Related
Jan 15, 2006
Hi
I have a subform on which I log the times spent on any particular project.
I have another subform on which I want to select a month and use this to select all the instances on which work was done on any given project for a particular month. I would prefer to use a pop up calender to select the month (i.e. by slecting the last day of the month in question)
Has anyone got any idea how I might do this - I am completely stumped.
Thanks in advance
Cheers
Rob
View 14 Replies
View Related
Jan 27, 2006
Right, I think this is a quick and easy one....just not for me!
I have a combo box with a list of names. I want to use whichever name a user selects as criteria for a query.
What do I need to type in the query criteria box or as SQL?
View 2 Replies
View Related
Jan 19, 2006
I choose a ‘Year’ from a combo box. Why doesn’t the data in my textbox update? (It’s a count of records for that year)
View 2 Replies
View Related
Mar 20, 2006
A tricky one this. Searched for answer but cannot find.
Acc 2003.
I have a main menu with 2 subforms.
In the on load event it sets the source object of the first subform, which displays a list of options (menu Style).
When choosing an option from SubForm1, I want SubForm2 to display the form I have coded in.
I currently have within subform 1 in the on click event the following.
Form_MainMenu.subform1.sourceobject = "formtodisplayinsubform2"
When running this from the main menu, nothing at all happens.
When opening just the subform 1 on it's own and clicking the option, it merely opens the main menu form.
Can anyone see what I am missing?
Thanks in advance
View 2 Replies
View Related
May 8, 2013
I inquired on this original thread [URL] .... to hide/show fields based on two Yes/No dropdowns.
Summary:
1.
If "OtherUnivEmployeesInvolved" = "Yes":
The fields
"OtherUnivEmployeeFullName1"
"OtherUnivEmployeeFullName2"
"OtherUnivEmployeeFullName3" are shown.
If "OtherUnivEmployeesInvolved" = "No": These 3 fields are hidden.
2.
If "OutsideRepresentVendor" = "Yes":
The fields
"OutsideIndividualLastName"
"OutsideIndividualFirstName"
"OutsideIndividualCompanyName"
"OutsideCompanyStreetAddress"
"OutsideCompanyCity"
"OutsideCompanyState"
"OutsideCompanyZip" are shown.
If "OutsideRepresentVendor" = "No": These 7 fields are hidden.
I have this basic validation code when a user hits the save button:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.Tag <> "skip" Then
[Code] .....
Within "1." - If yes is selected, I only need "OtherUnivEmployeeFullName1" required.
Usually skipping FullName2 and FullName3 would be easy using the ctrl.tag "skip" but I am already using the control to show hide these fields so how to do that.
Within "2." - If yes is selected, I need all 7 fields required.
So I need to figure out how to require fields based on those Yes/No selections because right now the form is checking every field regardless of the yes/no selections. I would also need to skip "OtherUnivEmployeeFullName2" and "OtherUnivEmployeeFullName3" everytime.
View 13 Replies
View Related
Jul 29, 2012
if it is possible whereby if a user makes a selection in combobox 1 it must automatically generate the given vaules in combobox2 from the selection in combobox 1.
View 1 Replies
View Related
Oct 18, 2011
I know how to assign an event to a combo box, but I want to be able to launch a specific link, app, or email template, based on the actual selection from the combo box. So when I make a selection, whatever program or event I assign, to that specific selection, will launch.
View 14 Replies
View Related
Feb 25, 2005
Here's what I'm trying to do:
Form A is used for data entry into SampleTable. On this form I have a some fields including these two: ReplicateA, LabBatchCode.
The database contains another table, IndividualSampleTable. This table contains two fields: ReplicateB, LabBatchCodeReplicateB.
When the user enters information into Form A, the data in fields Sample.ReplicateA and Sample.LabBatchCode are used to populate IndividuallSampleTable. But here's the twist: On IndividualSample Table, IndividualSample.ReplicateB needs to be autogenerated (I guess). Then the field IndividualSample.LabBatchCodeReplicateB is comprised of LabBatchCode entered in Form A, concatenated to the IndividualSample.ReplicateB field.
To make it tricker, the number of records added to IndividualSample table is determined by the value supplied on Form A in the field ReplicateA.
So, Form A could look like this:
ReplicateA: 3
LabBatchCode: CRBR05151998
IndividualSample table should end up with three records like this:
ReplicateB: 1
LabBatchCode: CRBR051519981
ReplicateB: 2
LabBatchCode: CRBR051519982
ReplicateB: 3
LabBatchCode: CRBR051519983
Hope this makes sense! And I appreciate the help!!!!
View 1 Replies
View Related
Apr 28, 2005
My table, TblTYPE, will contain two field.
TYPE
DURATION
There will only be 7 records in this table:
FUS, 30 minutes
POS, 30 minutes
PRE, 30 minutes
NOV, 90 minutes
FUL, 90 minutes
ANN, 90 minutes
NPB, 60 minutes
1st question: How do I enter only minutes in the table for field 2?
------
I want the following to happen.
The end-user enters the start time and the type. As soon as the type is entered, field three calculates an end-time based on the start time and the type. When the type is entered, the minutes listed in field two of the type table are added to the start time (giving you an end time).
Can anyone help me?
1.) How to properly format the minutes in the original table.
2.) How to add the minutes to the original time in a query.
Thanks!
Scott
View 2 Replies
View Related
Dec 30, 2005
I have a form with three subforms, and I'm having problem with one of them. The link between subforms and forms are store number, which is stored in a combo box. Idealy, after a user pick a store from the combo box, the subform would update itself. Two out of the three subforms are based on two crosstab queries and they work perfectly fine. The last subform is a select query, and it seems like it's not rerunning itself after updating the combo box. The query is very simple, it just has store number, description, and grouped by amount. I tried with no criteria in the store field and run the masterform,seems like all it's doing is showing value for the first store in the table, and never changes afterwards, I also tried entering "forms!frmStores!cmbStore" in the criteria for the store, then the subform came out empty, it seems like it's only reading combo box's default value null. I have a line of code for the mater form frmStores as "me.[DisplaySubform].requery" for all three subforms, but it seems like it's working for the first two and not the select query. Anybody can help me with this? oh, the combo box is unbounded, because i do not want my table to be updated by selection. Please help
View 1 Replies
View Related
Apr 10, 2006
Hello!
I have almost completed my database, everything I had originally intended to implement into it has been done, with some extra added features I popped in along the way. There is just one more thing I require assistance with...
My database is used for booking camera kits in and out. On the add booking form the user has to pick a "Camera Type" from a combo box. When they have made their selection, a form pops up with details of all of the components contained within the kits. The user can then check/uncheck the relevant components and close the form.
I have used a command button which prints off the data contained within the current booking form, and also the data contained in the form that pops up when the camera type is selected.
However, as there are more than 1 different types of camera, comprising different components, I need to be able to print off the form relevant to the kit type.
I do not know how I can do this as I have just specified the command button to print the form for the default kit.
I basically need some VB code which will print the form based on my combo selection, as my knowledge of VB is pretty primitive, I was wondering if someone could help me out :)
Any help would be appreciated!
View 2 Replies
View Related
Sep 26, 2005
I need help to populate a certain selection from a drop-down (combo box).........OK I have a field named REP ID/REP NAME....(Rep stands for contractor)....Each Rep is assigned an ID and the first two numbers in the rep ID correspond to the territory in which they sell products...So for example 5830 John,Smith the 58 would be Northern California....Now what I want to create is a field named TEAM which would consist of Team A through Team D....Every Team is associated with different territory numbers to lets say I click 5830 John, Smith I would want Team A to automatically be populated in the TEAM field....Someone please helpp....And I hope I described it correctly
View 1 Replies
View Related
Nov 10, 2005
Hello,
I am trying to create a unique reference number that includes the default autonumber and another count based on what the user selects from a dropdown (B).
For example, the reference might look something like these examples:
AutoDropdwnADropdwnBCount
001DrinkMocha1
002DrinkEGrey1
003DrinkEspresso1
004DrinkLatte1
005DrinkEGrey2
006DrinkEGrey3
007DrinkEGrey4
008DrinkEspresso2
009DrinkLatte2
010DrinkEspresso3
I will eventually create a unique reference by combining all the data (ie: 004-Drink-Latte-1, 010-Drink-Espresso-3) but it will allow me to number each type of drink in ascending order irrespective of the autonumber (which is the primary key.)
I would appreciate any advice on how to approach this! I am baffled!
Thanks,
dj_T
:eek:
View 2 Replies
View Related
Jan 8, 2006
right, struggling here.
Basically I have continuous form listing all the standard letters sent out when I double click on a letter, I need to to run a query for me. The code I have put behind the button is:
If ([StandardLetterType] = "Homework") Then
DoCmd.OpenQuery ("qryHomeworkClearMailMerge")
DoCmd.OpenQuery ("MergeHomework"), , , , , acDialog, Me.[StandardLetterID]
DoCmd.OpenReport ("rptHomework"), acViewPreview
Else
'
end if
and in the query I am first clearing the mailmerge yes/no field out which works fine and then running the merge to put the yes back in the current record so the query looks like this
Its an update query with update to yes for mailmerge and under the standard letter ID i have the criteria [Me].[OpenArgs]
is this completely wrong tried the [Forms!][frmFullStudentReport].[standardletterID] but it kept popping the box up asking for the number.
On the form I have the standardletterID and its hidden but there.
Any help would be greatly appreciated
View 1 Replies
View Related
Jul 2, 2005
Greetings! This forum has been most helpful to a rusty Access user.
I'm creating a student group score entry form, having problems with creating the form I want. Say for example we have the following:
1. Three groups: A,B, and C.
2. Group A has 5 students, Group B has 3, and Group C has 20.
I want a form where I can select group A, and a list of the students will populate and enable me to enter scores for all of them on the same page. This will save time not having to re-enter the information for so many students. If anyone has a clue of what I'm talking about or is willing to lend me aid, I would appreciate it.
Cheers.
View 4 Replies
View Related
Aug 19, 2005
Ok, here is my question. I am just a little rusty since it has been a while since I have been in Access.
So I have a option group: option 1, option 2, option 3
If option 1 is selected I want textbox 1 visible, but textbox 2 and 3 not visible.
If option 2 is selected I want textbox 2 visible, but textbox 1 and 3 not visible.
If option 3 is selected I want textbox 3 visible, but textbox 1 and 2 not visible.
When the form first opens, all textboxes are not visible. What is the correct way to do this: code, macro, etc? and where should I place it? Should it be in the Afterupdate property of the option group?
Thanks!!
View 1 Replies
View Related
Oct 25, 2005
I have a form which has a listbox listing all the letters a student has had sent home. Basically i want to be able to click on a letter in the list box and for a popup form to open with the record details. However it just brings up a blank record.
The list box has a unique field called standardletterID.
the code behind the button to filter was just used through the wizard to open the popup form is:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmstandardletterspopup"
stLinkCriteria = "[StandardLetterID]=" & Me![List0]
DoCmd.OpenForm stDocName, , , stLinkCriteria
but it doesnt seem to be working :(
I thought this would be easy but no matter how much i destroy my database trying to do it its not playing ball!
View 1 Replies
View Related