Forms :: Cannot Use Vbe To Change Rowsource On A Form

Jul 15, 2014

I'm trying to change a rowsource depending on the value in a form. I want to be able to change the value and update the form accordingly. I can change the query but when I try to add the "where" statement to it, I get nothing.This is what I'm using:

Private Sub RepID_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT DISTINCT [Cust No] & ' ' & [Name] FROM [Address Book] WHERE [Address Book].[Cust No] = '" & [RepID] & "' "
Me.NamesList.RowSource = strSQL
NamesList.Requery
End Sub

View Replies


ADVERTISEMENT

Forms :: Combobox In A Form To List Values Of A Field In A Table - Rowsource

Apr 14, 2014

So I have a combobox in a form that lists the values of a field in a table. The rowsource is this:

Code:
SELECT [Estes Training Modules].[Training Module], [Estes Training Modules].[Period] FROM [Estes Training Modules] ORDER BY [Period];

The problem is that ALL values on that field show up, including repeated values. I only need each different value to show up once. How can I do that?

For example, what I get in the combobox is: Annual, 2-Year, Annual, Annual, 2-Year, 3-Year,...

What I need is: Annual, 2-Year, 3-Year,...

View 10 Replies View Related

Forms :: Passing Listbox Rowsource To Another Form Listbox

Dec 14, 2014

Using a popup form

1. On my main form, I have a listbox, I would like to edit the values of the listbox.

To do this, I have a popup form with 2 listboxes, one to have the values of the listbox on the main form, and the other listbox with option values for the 1st

1) how to i pass the rowsource sql of the listbox on the main form to the listbox on the popup form

2) how on closing the popup form, do i update the rowsource sql listbox on the main form from the changed value of the popup form listbox rowsource sql

View 3 Replies View Related

Forms :: Possible To Add Values To Rowsource

Aug 16, 2013

I have a basic SELECT DISTINCT query for my CBO rowsource. Is it also possible to add custom values to the rowsource? i.e. I'd like my CBO to look like....

Custom Value
Query Value
Query Value.....

View 4 Replies View Related

Forms :: How To Get RowSource For Combo Box Based On Value Of Different Object

Sep 9, 2013

I have a form with several objects:

Projects -> which have Sources -> which have SourceTypes

The underlying DB has tables for Projects, Sources and SourceTypes:

Code:
Table Projects;
Fields:
ProjectID : AutoNumber;
etc, etc

[Code] ....

So, I'm trying to get all the Sources for a given ProjectID, and I'm using the following SQL statement:

Code:
SELECT ID, ProjectID, Sequence, Name from Sources WHERE [Sources].ProjectID= MyProject.ProjectID;

Which actually gets coded (because MyProject.ProjectID is a variable) as:

"SELECT ID, ProjectID, Sequence, Name from Sources WHERE [Sources].ProjectID= " & MyProject.ProjectID & ";"

What actually happens is that Access jumps in and says (via a Message Box) "Give me a value for Source.ProjectID.

I've just done that in the SQL statement!

How do I get a 'real' SELECT to work for the RowSource?

View 5 Replies View Related

Forms :: Setting Combobox Rowsource To Be A Recordset Instead Of Query?

Jul 15, 2015

I have a Product form that shows the details of each of the Products in my Product table. I also have a "Pick a product" combobox (who's rowsource is being fed by the same Products Query that feeds the form). This allows you to go straight to a particular product by selecting its name. So far, so simple.

I've since added a couple of combobox filters which use different columns ("Product Type" and "Collection") to allow the user to get down to a more manageable recordset to then work with.

Of course, because the "Pick a Product" combobox is being fed by the Products Query, the combobox can end up showing products that are not contained in a filtered recordset. This is... sub-optimal.

Is there a way of telling the "Pick a Product" combobox to use the products listed in the recordset as its rowsource rather than the product query? So that it only lists the products the user has filtered down to?

View 3 Replies View Related

Forms :: Error 13 When Setting Rowsource Of Combobox Using Union Query

Jan 18, 2014

I am trying to design an unbound combobox whose rowsource can be dynamically set based on a union query in order to search 1000's of names returning each name that contains a user defined string. The search does not start until the user defined string reaches 3 characters in length.

There are more details in the attachment but basically the vba code I used all saves OK in the vba editor but I get a runtime error 13 type mismatch when the code attempts to utilise the query to populate the rowsource of the combobox.

View 10 Replies View Related

Forms :: Use Buttons On A Form To Change Sort Order On A Continuous Form

Jul 23, 2013

I want to use buttons on a form to change the sort order on a continuous form. In the buttons click event I am using a public function (named Sort_1) to change the sort order. The first element of the event call is the name of a generic query (named Sort_1_Query1) and the query field to sort (LAST_NAME OR FRIST_NAME, depending on the button.)This is the Click Statement.

=Sort_1("Sort_1_Query1","LAST_NAME")

This is the Public Function
Public Function Sort_1(SortName As String, FieldName1 As String)
DoCmd.ApplyFilter SortName, FieldName1 & "between 'A' and 'Z'"
End Function

I think the problem is in the use of quotation marks or trying to pass the query field name to the Do Command or the use of an ampersand.

View 4 Replies View Related

Forms :: Change A Subform To A Popup Form

Sep 24, 2013

I had a subform to enter payments. It worked well. The master and child fields linked well and all the necessary data appended to a new record in the payments table.

Now to make it more user friendly, I changed the subform to a popup form (The 2 forms took up too much real estate on the screen).I deleted the payments subform and created a command button to open the payments form as a popup.

I need 3 fields on the payments form to be populated from the edit sponsor form (sponsorID, MemberID, SponsorTypeID) and then payment details to be entered and posted to a new record in the payments table.Since I've changed the payment form from a subform to a popup form, the master/child relationships are gone and the 3 fields I need for the payment record no longer appear.

View 1 Replies View Related

Forms :: Change Form Icon Next To Caption?

Jun 12, 2014

how to change a form icon and make that icon embed to my database, I have tried the Application Icon property in Access Options but when I copy the database to other computer then the icon disappeared.

View 3 Replies View Related

Forms :: How To Change 2 Field Names With VBA Code Within A Form

Nov 28, 2013

I have two text fields:

their names are :

field 1 ="txtfilter"
and
field 2: "text333"

How can i change the names of the two fields with vba code?

I need field 1 to get the name of field 2
and field 2 to get the name of field 1

This will be temporarily.

using access 2013

View 5 Replies View Related

Forms :: Update ListBox On Record Change In Form

Apr 30, 2014

I have a form with a listbox in it. I want the listbox to update as the record changes.Let me get a little more in-depth...The form will be used to identify merchandise that exists in the company to fulfill current POs.

What I want is for the listbox (which displays Store Locations) to update when the PO# updates on the form (so as the record changes).Currently, the listbox only pulls all the store locations no matter if you hit next record to get a new PO.The two main fields I am working with are PO# (text box) and Store Locations (the listbox).How can I get the listbox to update as the record changes on the form?

View 1 Replies View Related

Forms :: Copy Form Data To Report After Change

Feb 19, 2014

I have a continuous form that has 5 columns of data per line and it also has a 6th column that I can enter data into. What I want to be able to do is if I enter data into the 6th column it will copy that record except the 5th column to a report.

I have tried searching this forum and other but not quite sure of the terminology so not getting good results.

View 2 Replies View Related

Forms :: Datasheet Form - Change Text To Time

Oct 7, 2014

I am needing to design a form that allows a user to add or overwrite a number of records by copying and pasting the information from an Excel Spreadsheet, however one of the problems is that the information being sent has times stored as text - so, for 04:45, it is simply stored as 0445 on the spreadsheet.

Is there a way to have these autocorrect once pasted into the datasheet?Also, is there a way to make a datasheet form that copies a number of records into itself depending on a user selection? The basics of what I am trying to achieve is:

I have a number of services that operate on a number of services (public transport), each vehicle has a unique identifier (Bonnet), and each place in the schedule has a unique identifier (RunNo); there are different schedules for different day types (Saturday, Sunday, Monday, Tuesday to Thursday, Friday and so on), and the times that each RunNo goes out and comes in differs depending on the day type.

At the moment, I have a table which has the following fields:

ID (Autonumber, PK)
DayType
Route
RunNumber
TimeOut
TimeIn

My idea/hope is that a user will be able to open a vehicle allocation datasheet for the day, select the day type (lets say, Saturday) which will then populate the relevant number of rows with the schedule information (looking at a Saturday, that would be 128 rows), and then a blank column to add to the records a vehicle ID that is being used for each RunNo for the day.

Now, on top of all this, I need to also cater for vehicles being substituted during the course of the day - - - if one breaks down, it will have to be de-allocated from the list (so presumably by changing the TimeIn to the current/actual time rather than the scheduled time) and the user will need to be allowed to add a further row to show which vehicle was used next against that RunNo.

Just to further complicate things, there is quite a number of vehicles that will have a time in which is in the following day (ie after midnight) - whilst this isn't a problem in storing the times, I also want this table to be looked up to determine whether a vehicle is currently allocated or not.

The fields for the AllocatedVehicles table are:

ID (Autonumber, PK)
RunNumber
Bonnet Number
DateOfService
TimeOut
TimeIn

It is hope that all of these with the exception of Bonnet Number can be populated by selecting the day type?

View 1 Replies View Related

Forms :: Button To Change Form From View To Edit

Mar 12, 2014

I have created a form in Access 2010 that opens in view only mode. I do this as I do not want data being changed in error. There are times when the user may need to edit some data on the form.

Any way to place an "Edit" button on the form that allows the user to edit the current record? I thought about creating two sepasrate forms, but I really don't want to maintain two of them.

View 1 Replies View Related

Forms :: Using Form To Update Location Change Of Inventory?

Dec 2, 2013

I have an inventory of equipment that is assigned to different locations. When repair is needed, the equipment is brought in and swapped with a loaner. How can I update on a form the location change from "A" to "Shop" that will show up on the related equipment table? I have "Location" in the table, but don't know if I need something to the effect of "NewLocation" to assist in showing the equipment swap.

View 4 Replies View Related

Forms :: Change Default Way A Field Is Selected In A Form

Mar 2, 2015

Any way to change the default way a field is selected in a form so that it doesn't highlight all the text when you tab?I have the standard black text on a white background but when the whole field is highlighted it looks ugly and I think is quite difficult to read until you click into it.

View 3 Replies View Related

Forms :: Change Button Color After Data Change

Apr 5, 2014

I am trying to change the button color on a subform if a related form data changes.Main form is products with a continuous subform with serial numbers of products i.e, serial number, location, price and a button to add addtional issues if there are any for this particular serial number (this will open up another form related to the serial number so I can add an issues if there are any).The reason I would like the button to be a different color is so I can quickly see if there are any additional notes been added to the serial number. Just in case you may ask why not add the field to the continuos form is that the issues and be quite lengthy and there may be lots of serial numbers on the form

2346 location warehouse price 29.99 (button - green)
2347 location shop price 29.99 (button - red)

View 1 Replies View Related

Forms :: Access 2010 - Change Theme For A Single Form?

Oct 31, 2013

Is it possible in Access 2010 to change the theme for a single form? I do not want the theme for all my other forms to change, but only for 1 specific one.

View 1 Replies View Related

Forms :: Image Change Based On Combo Box Selection On Form

Jun 21, 2015

I have been looking some information on changing image based on form combo box selection on form.

I manage to do case by case but i need it in a simple code because their will be many employees just to avoid adding case by case code for each one.

Private Sub Emp_IDCombo_AfterUpdate()
Select Case Emp_IDCombo.Value
Case "AM-001"
Imageholder.Picture = "C:UsersAMGDesktopam-001.jpg"
Case "AM-002"
Imageholder.Picture = "C:UsersAMGOne DocumentsHR & Admin DatabaseEmployee Picturesam-002.jpg"
End Select

I have employees table where all images location is saved in text field and i have a combo box on form which is employee id.

Tables relationship
Employees_table [PK] to Contracts_table [FK] via field name {emp_ID}

Fields Name
Combo Box name on form Emp_IDCombo and row source is SELECT Employees_table.Emp_ID, Employees_table.EmployeeName, Employees_table.Emp_Pics FROM Employees_table;

Text field is located in employees_table called [Emp_Pic] for images location.

View 10 Replies View Related

Forms :: Allow User To Change Form Colours And Captions Each Year

Jul 28, 2014

My database has a front end that uses forms to allow the user to navigate within it, each year we create a new database which is based on the previous year's database but with all the variable information removed.

Within the database each form has a caption that starts with '2014-15' then goes on to say the form name.

Most of my forms also have a yellow background, (last year it was pink).

Both these areas were set up so that each year our users can distinguish between our databases, as they may have last years and this years open at the same time.

What I would like if possible is to know whether I can get a user to change both these things from within a form. So something along the lines of a button that when clicked would check all form captions and if within the caption it finds 2014-15 then change it to 2015-16 (or whatever the user specifies) but keep the rest of the caption.
I would also want the same type of thing to happen with the colour so again within the background of the forms, if you find colour X then replace it with colour Y.

If this can't be done within a front end form, then could it be done behind the scenes, and if so how would I go about doing it?

View 2 Replies View Related

Forms :: Change Form Details Based On Two Combo Boxes

Jun 12, 2014

I have two combo boxes in the form header and command buttons in the form detail. The combos allow the user to select either a customer or a prospect, then the command buttons open forms that only show records pertaining to the customer or prospect selected. Combos are "4Custcbo" and "4Proscbo".

1.How do I change which command buttons are available depending on whether the user has selected a customer or a prospect? Do I use two different subforms or is there a better way?

2.How do I hide the other combo box once the user has selected either a customer or a prospect?

View 3 Replies View Related

Forms :: Duplicating Tabbed Form And Change Record Source

Aug 7, 2014

I have a navigation form that has a tabbed form on one of its tabs. The tabbed form has a 'current client' query record source and allows one to choose from a list of current clients and when a client is selected - details relating to client are displayed on various tabs on tabbed form.

I want to duplicate tabbed form and change record source to a query selecting 'exited clients' so I can see same information but for exited clients.

I have created a new tab on navigation form for my new exited clients tabbed form and changed record source by creating a new exited client query but when I change record source on exited client tabbed form it automatically changes record source of current client tabbed form to the exited client query and visa versa.

View 3 Replies View Related

Forms :: How To Change Drop Down Box Options In Form Without Affecting Table

Jun 20, 2014

I'm a new user of Access and I'm required to input a survey into access. The data collected is being analyzed afterwards and therefore there cannot be any alpha content in the original table so I assigned multiple choice options numbers to correspond to the answers. In form view however I need the drop down boxes to spell out the answers, not just the numbers so the interviewer can read them out, I've seen this done on other similar surveys..I also tried going into form view and editing the drop down choices but that changes the table values.

View 1 Replies View Related

Forms :: Continuous Form - Change Color Of Single Record

May 1, 2014

I have a continuous form based on a orders table and a details sub form.I list all the records in a continuos form in date of order.i need to change the colour of a single record based on the condition of a tick box on the original orders form

View 1 Replies View Related

Forms :: Change Textbox Background Colour Pending Value Of Two Textboxes On Form?

Jul 9, 2013

I have a form with two textboxes that get their values from two different queries that counts records from table. If textbox1.value equals texbox2.value the textbox2.value back ground colour is green. If they are not equal textbox2.value goes red. Itried with using conditional formatting, but it doesn't work all the time as the form is not updating when it is opened.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved