This is my first post, but I've been lurking for sometime. I'm grateful for all the great advice given here; despite my efforts, I can't find anything directly related to what I'm doing, though.
I have a form that is populated from a query. The query has some calculated fields and some direct selection fields from a couple of tables. One of the direcly selected fields is one that I'm trying to populate from the items in a list box.
On this form, there are two list boxes, List1 and List2. The user makes selections in List1 and clicks a command button, which runs code so that the second list box is populated with the items from List1. This was shown here:
MS Article (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office03022000.asp)
I actually just used this code and made changes accordingly so that this feature is working perfectly. However, the items in List2 need to be updated into a table's field, and this is where I'm having the problem.
I've got List2 bound to the proper field in the query, and I can manually run that query and make changes in that field fine. What I can't figure out is why I can't get the ItemsData property of the List2 control in there. For ease of code, I've added a line that copies the List2 rowsource variable to another variable so that the values can be used elsewhere. I can't seem to get the field to receive the variable in VBA, and I can't figure out how to get the values back into the query so that the query's source table is updated.
Any clues? Or is this unclear? I'm happy to give any further information. I've been working on this for more than a week, trying different things, and I'm at wits' end.
I have a form that contains a combo box (cboEmployeeName) that pulls data from a query and populates three text boxes (Work Area, Last Name, First Name), This part works fine. Because the text boxes are being populated by the Combo box, they are not bound to the record source tblTrainingSchedule). I need the info that is in the text boxes to populate the respective fields in the record source.
I tested by adding "=tblTrainingSchedule!WorkArea=[cboEmployeeName].Column(3)" (column 3 is the work area) to the "after update" control but it does not populate the data.
I am working on a database for a bowling tournament. I'm currently working on a form where the user selects from a combo box bowlers' names for doubles pairings. I thought that as a helpful tool I would also display a list of available remaining bowlers once the combo box information has changed.
I'm trying to write a module for the combobox_change trigger. What I'm having trouble doing is pulling the updated recordset from the base form and using that to update the availability box -- in other words, how can you query data from the recordset underlying an open form before the form is closed and the data is saved to the tables. The only way I can do this now is to temporarily close the form, manipulate a recordset from the table, then re-open the form. There's got to be a better way. Maybe I'm just missing something here.
I have two tables, tblCountry and tblLocation. With the following structure
tblCountry ID Name Text
tblLocation ID Country_fk Name Text
As you can guess tblCountry lists all of the countries, tblLocation lists all of the locations in each country, the tblLocation.Country_fk field is linked to tblCountry.ID.
I want the user to be able to edit [tblLocation].[Text] using a form. They simply select the country and then the location using combo-boxes and then add or edit the content using a textbox.
In my form I have a combo-box that displays the country names, the RowSource is set to SELECT [tblCountry].[ID], [tblCountry].[Name], FROM tblCountry ORDER BY [Name];
I then have a second combo-box that lists the locations for the selected country. This uses an AfterUpdate() procedure to select [tblLocation].[ID] using an SQL query based on the value of the country combo-box. I.e:
SELECT [tblLocation].[ID],[tblLocation].[Name],[tblLocation].[Text] FROM tblLocation WHERE [Country_fk] = " & Me.country_box.Value & " Order By [Name]"
I want to be able to have a textbox that then displays [tblLocation].[Text] for the selected location. Thats where the problem arises. I can't find a way that will let me display any content thats available for the selected location AND let me edit it. I've tried using UpdateAfter procedures, different bindings (tables, queries based on the value of location combo-box).
Can anyone suggest how I can display [tblLocation].[Text] based on the value of the selected country/location and be able to update the information via a textbox?
I have three list boxes on a form (lstSubjectName, lstTargetGrName, lstCountryName). The list boxes are populated from queries based upon tables that have a many-to-one relationship to the main table. The queries are the following:
SELECT tblProjectSubject.ProjectID, tblProjectSubject.SubjectName FROM tblProjectSubject WHERE (((tblProjectSubject.ProjectID)=[Forms]![frmViewPro]![ProjectID])) ORDER BY tblProjectSubject.SubjectName;
SELECT tblProjectTargetGr.ProjectID, tblProjectTargetGr.TargetgrName FROM tblProjectTargetGr WHERE (((tblProjectTargetGr.ProjectID)=[Forms]![frmViewPro]![ProjectID])) ORDER BY tblProjectTargetGr.TargetgrName;
SELECT tblProjectCountry.ProjectID, tblProjectCountry.CountryName FROM tblProjectCountry WHERE (((tblProjectCountry.ProjectID)=[Forms]![frmViewPro]![ProjectID])) ORDER BY tblProjectCountry.CountryName;
The form is based on the main table (tblProjects). I want to re-populate/update the list boxes when the ProjectID on the form changes. I have tried to use a macro (ProjectID_AfterUpdate) for requery of the list boxes, but can't get it to work. Any other solutions? Thanks. Niels
I have a form called Adaptation Form in which Last Name and Course Number are entered.
The user looks up Last Name using a listbox on the form, and looks up Course Number using a second listbox on the form.
To use the form, the user looks up Last Name in the listbox, finds the ID number associated with the Last Name, and enters the ID number on the form. The form then autopopulates with the last name. The process for entering a Course Number is the same.
This populates the query underlying the form, but not the table. All that gets populated in the table is the ID Number for Last Name and the ID number for Course Number.
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.
Using Access 2010. Fairly new to automation and macros.I have two tables (tblProductReceived and tblBins) and a form (frmProductReceived).A field in tblBins corresponds to a location the bin is at (named BinLocationID) and the tblProductReceived table tracks product that a specific bin has received.
What I need is for the tblProductReceived field PRLocationID ([tblProductReceived].[PRLocationID]) to be automatically populated with where the bin is at ([tblBins].[BinLocationID]) when selecting a specific bin in the form (frmProductReceived).
I am trying to take text from two different text boxes on a form and place into another text box on the form. I want it to also update the table with this new text.
Example: fname, lname, fullname are text boxes on a form. when user enters fname and lname, I want the two strings/text to be added together and placed in fullname while also updating the table with the fullname text.
Client records from tblClient contain a field called Client_CID (Primary Key), as the Client ID. There are also fields Client_HIGH_FILE_NO, a numeric value of the last case number assigned to the specific client and Client_PREFIX that contain a unique three letter prefix that identifies the client.
Case records from tblCase contain a field called Case_CFN (Primary Key), as the Case File Number. tblCase also contains a field called Client_CID that contains the Client ID associated with the case (obtained from a combo box lookup from tblClient).
My form is frmCase bound to tblCase.
The Case_CFN is constructed by combining the value of the selected Client_CID’s Client_PREFIX with the value of Client_HIGH_FILE_NO plus 1.
I am constructing the Case_CFN on the before update event of the combo box for selecting the client. The resulting Case_CFN may appear as follows
ABC10001
Where Client_PREFIX = “ABC” and Client_HIGH_FILE_NO = 10000
Now, I need to increment Client_HIGH_FILE_NO in tblClient by 1, meaning I need to set the value of Client_HIGH_FILE_NO for the selected Client_CID to, in this example, to 10001.
Questions:
1) Is anyone familiar with this type of number scheme generally and if so any ideas?
2) Can anyone tell me how to update the value Client_HIGH_FILE_NO for the selected Client_CID?
I have a table holding clients data, I need it to work out the age of someone when an application is made, which I would like to be stored on said table. I have two fields [DOB] and [signed date], which I have used created a query with and an (unbooud?) field called age at application with the expression =DateDiff("yyyy",[DOB],[Date signed])
This works fine when I run the query, but I am unsure of the new next step of how to commit it to the table and even if that's possible.Ideally I would like this to run behind a form maybe using some click event after the [signed date] field has been entered.
I have created a Public Function that would get a new Production Instructions number based off the [PI Number] of Tbl_Production_Instruction table.
I have a form that people will put in all information but the PI Number, then when ready they will click a button to update the PI Number. I place an unbound txtbox that will be hidden, with the control source to =NewPINum(), but when I tested the see if the unbound txtbox was populated with the new PI Number it was blank.can't figure out what I am doing wrong.
Code: Public Function NewPINum() As String Dim vNum As String Dim strYYMM As String Dim getnextPI As String strYYMM = Format(Date, "yy") & "-" & Format(Date, "mm") & "-" If strYYMM = Left(DMax("[PI Number]", "Tbl_Production_Instruction"), 6) Then vNum = Right(DMax("[PI Number]", "Tbl_Production_Instruction"), 3) vNum = vNum + 1 getnextPI = Format(Date, "yy") & "-" & Format(Date, "mm") & "-" & Format(vNum, "000")Else vNum = "001" getnextPI = Format(Date, "yy") & "-" & Format(Date, "mm") & "-" & Format(vNum, "000") End If End Function
i have created a form and its working correctly. however i have just been informed some of the fields needed deleting and different ones put in their place. so im just wondering if there is anyway to updated the field list so i can just add the new fields without having to recreate the whole form.
Here's a query that the bottom listview in the attached form i.e. a listview representing a table of calls(many) to fims (1 top listview)
Code: SELECT calls.id, calls.firm_id, calls.called, calls.said, calls.spoke_to, calls.next FROM calls WHERE (((calls.firm_id)=[firms].[id])) ORDER BY calls.called DESC , calls.next DESC;
When I run the thing...I get a dialog asking me for firm id.
I want to change this so when I move up and down the firms LV (top)... the bottom LV updates taking firm id from the top LV with focus.
I have got what seems to be a pretty straight forward task i need to do!
I have got a table named tblInput, with four fields Type, Collection, Value and Reason.
I need to give the Type field two possible options "a" or "b", i then need the Reason field to display a list of values depending on whether "a" or "b" was selected in the Type field.
Values for "a" need to be "Success", "Failure" or "Rejected"
Values for "b" need to be "Status Change" or "Amendment"
I have been playin for a couple hours now trying various differnent methods but i am commin up short, its this something i am able to do from a table?
I have a form where I type in the time a person starts a job. The format is Medium Time. I also have a box where I type in the End time for that job. Also formatted in Medium Time. I have another box that is for if a break happens during that job to return the value 10. My formula for that box is: =IIf([Start Time]<"9:00 AM" And [End Time]>"9:10 AM",10,0). The problem that I am having is that it only works when the time is in the 9:00 AM to 9:59 AM time frame. I need it to work where if a person starts at 6:00 AM and gets done at 2:30 PM to return the value of 10.
I am trying to make a simple database where the data entered in a form will update to a table. My issue is, one of the fields is manufacturing location where I would like the user to be able to enter multiple locations and then have those locations update the table where the record is stored. I've been able to set up a list box with multi-select but am stuck at getting the table to update with the choices made from the list box selection.
hi guys i have a list box which has 4 columns that come from a query. when a user double clicks a selected item, i want the frmUPdate to open with the selected item; it gives me no error it just always goes to the 1st contract . have no idea what else to try...
here is the code:
Private Sub List33_DblClick(Cancel As Integer)
Dim rs As Object
DoCmd.OpenForm "frmUpdate"
Set rs = Forms!frmUpdate.Recordset.Clone rs.FindLast "[ContractID] = " & str(Nz(Me![List33])) If Not rs.EOF Then Forms!frmUpdate.Bookmark = rs.Bookmark
I'm new to access, but not new to databases in general. I'm having what should be a common problem/question, but I cant seem to find much on it.
For example, I have a standard table, with ID, text and a "yes/no" (lets call them booleans). I've made a query for that table - of only records with the boolean to no.
I have a form which displays the query. If it i put the boolean to yes, it still stays on the list until the form is opened and closed. This could be useful but if I want it to do it right away, what should I do? I didn't see any simple VB or macro command anywhere. Should i script open and close? Use a SQL command to update.
I have a form based on a table and I just added 3 fields to the table. When I go to the form to add these fields, they do not show up in the field list. I've also tried creating a textbox and going to the Data Tab and choosing the data source but those 3 new fields are still not showing up. How can I go about adding these 3 fields?
I have a list (table) that I've created in sharepoint 2010.I link to the sharepoint table with Access 2010 to update mass amounts of items at once. Some of the queries have no problem updating the sharepoint items, but other queries require me to "Enter Paramater Value."
In this particular queries; I'm trying to populate field A with dates from field B, when field A is null.
--------------------- UPDATE Table 1 SET Table.[FieldA] = [FieldB] WHERE (((Table 1.[FieldA]) Is Null)); --------------------
When I run the above, I receive the "Enter Parameter Value" input box.All records have Field B populated (it's actually the created date.)
The goal is for field A to be populated with the values in Field B, without the query asking for parameters.
Note; I can go in each individual record and update them via access, one at a time. But it's the running of the update query that failing.
I've set up a split form for data entry on a form called "frmqryTask" that once opened, I'd like to be able to filter using list box controls.I've set up a couple of different reports with cascading list boxes to only pull in the information wanted on the reports and would basically like "more or less" the same functionality within a split form. I know I could do this before the form is actually launched using the same cascading list boxes, however the users need to easily by able to filter once inside the form. (I tried to show a couple people how to filter on the bottom section on a column called "SourceName" and they would up changing the values. SourceName is linked to another table as a combo box thru the lookup wizard in the table setup.)
There will probably be three different list boxes to allow for different filtering based on the combination of the values for;
I am currently creating a database to link together a maintenance system and a conditional reporting system and I’ve run into a little problem.
I am trying to create a form for assigning skills to a given contractor (contractor selected via a combo box (cboContractor)) by transferring selected items from a list box on the left (lstAvailable) to a list box on the right (lstselected). (much like any windows wizard would) This is done through the 4 buttons cmdSelect, cmdSelectAll, cmdDeselect, cmdDeselectAll.
Now it has been a long time since I have had to work with VB and I am struggling a little to create the required coding to pass data from one listbox to the other.
For reference:
CboContractor takes information from tblContractor. The data is ContID and ContName and the bound column is 1. LstAvailable takes information from tblSkills. The data is SkillID, SkillComm and SkillNotes. Bound column is 1 LstSelected will place data into tblcontskills. Tblcontskills has the fields, tcsID, ContID, SkillID
Can anyone help or does anyone know where I can find some good examples on the net as I have browsed through the search pages here and not really found a great deal that is valid