Modules & VBA :: Use A Combo Box To Specify All Donations Having A Specific Date
Nov 2, 2013
I have a query of "Donations" in a sub form and want to use a combo box to specify all donations having a specific date.is this a job for VBA code? or is there some other way.
I have a combox field on subform C that shows records from a query.How do I get this combo to only show records that relate to an ID on subform B.I have a subform for storing contracts and these are stored against a company name.On subform C I have a field that currently shows all records in a table. I need this combo to only show the records that relate the current record on subform B?
I have the below code behind a form so that a combo box will display a specific list of items based on the data in another combo box on my form.
I have two copies of this same form for two different departments. One of the forms works like a dream. However, when I copy that form, change the name, and update the code as pictured below, the form is asking for a parameter FROM MY ORIGINAL FORM and will not requery the combo box. I can't figure out why...there is no reference to the original form in my VBA as you can see below. I tried deleting the form and re-creating it, I tried deleting the code and re-typing it to no avail.
Private Sub cmboType_AfterUpdate() Me.cmboAction.RowSource = "SELECT tblStatusList.Status FROM tblStatusList WHERE (((tblStatusList.Department)=[forms]![frmInquiryFraud]![cmboType]));" End Sub
I have some code that filters job raised I have 2 text box's txtdatestart and txtenddate after entering. date range between the too text boxs it shows me all job raised with in the period.i have entered what I would like is filter it again by client field using combo box cboclient so if the user enter's client name in cboclient combo box and date range in txtdatestart and txtenddate it will only show jobs raised with in the date range of the client enter in the combo box but if the combo box is empty show.
Code:
Private Sub cmdPreview_Click() 'On Error GoTo Err_Handler 'Remove the single quote from start of this line once you have it working. Dim strReport As String Dim strDateField As String Dim strWhere As String Dim lngView As Long Const strcJetDate = "#mm/dd/yyyy#" 'Do NOT change it to match your local settings.
so i have an interesting question and im hoping that someone can help on this one. i need to pull date from a specific table, no problem, that's written and working fine, next i need to be able to join the data from another table by a primary key, again no problem. third, i need to be able to select the date (using WHERE) for a specific date range. (i.e. i enter the date range of 01/7/2007 to 15/7/2007) and the query comes back only showing the data from that specific time, not the data from before or after. this is where my problem lies, all the entered data is being shown after entering my date range. i am going to include my SQL statement, just so you can actually see what im really talking about.
SELECT srealest.Name0, srealest.Dist1, SREpayments.Face2Pd, SREpayments.Penalty2Pd, SREpayments.[2paid], SREpayments.Face3Pd, SREpayments.Penalty3Pd, SREpayments.[3paid], SREpayments.Face4Pd, SREpayments.Penalty4Pd, SREpayments.[4paid], srealest.Map, srealest.Parcel, srealest.LeaseHold, srealest.TaxRebate1, srealest.TaxFace1, srealest.TaxPenalty1, srealest.TaxYear, srealest.BillNo, srealest.PdRebate1, srealest.PdFace1, srealest.PdPenalty1, srealest.DatePd FROM SREpayments INNER JOIN srealest ON SREpayments.BillNo=srealest.BillNo WHERE (((SREpayments.[2paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[3paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[4paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date])) Or (((srealest.DatePd) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date])) ORDER BY srealest.Name0;
any thoughts or ideas on how to accomplish this would be greatly appreciated!
how to read a specific line in a CSV file (using VBA), to see if the phrase "There are no records available." is present.
If it is present, then I'm going to do a debug.print stating that there are no records to load - and then the script will move on to the next file. If the phrase isn't present, then I'm going to upload the file to Access, parse the information, and then upload it to a CRM. (I already have the latter portion of the code up and running....I just need to account for the first part, where I can determine if the file has data or not).
The structure of the file never changes. The first row is composed of eight column headers (Post Date, Card Number, Card Type, Auth Date, Batch Date, Reference Number, Reason, Amount) and (if) the phrase "There are no records available." is present, it will show up on the second row, in the first column (under Post Date).
I have a set of combo filters that filter one after the other as follows –
Code: Private Sub cboCity_AfterUpdate() If Nz(Me.cboCity.Text) = "" Then Me.Form.Filter = "" Me.FilterOn = False
[code]...
and so on to filter down so the user can work with what they filter, my question is how can I add on a filter that filters between dates? and second I was hoping that I could program the filters so that they could be changed individually/randomly as to filtering one after the other and then clearing to restart the filtering again if that makes sense. I have tried using this, but it doesn’t work ‘Bad Command’
I try to create an error message if a user fills in a date field and leaves a combo box with wrong value.I have no clue how to use "Is Not" to check the combo box.The date field that will be filled in is called "Sent to Check" and the combo box is called "Status Case" and the value should be "Sent For Check" If the value in the combo box is different, then the back ground should change to red and get a message.This is the code I have so far that does not work:
Code: Private Sub Test__date_started__AfterUpdate() 'XXXXXXXXXX working onXXXXXXXXXXXXXX If Not IsNull(Me.[Sent_To_Check] And Me.[Status_Case] IsNot "Sent For Check" Then MsgBox "Status Case be set to Sent For Check!", , "Incomplete Form!" Me.[Sent_To_Check].BackColor = RGB(255, 0, 0) Else Me.[Sent_To_Check].BackColor = RGB(255, 255, 255) End If End Sub
Ok let me explainI have a list of 50 people who may have accessed events A,B,C at different times but what I want to do is to put a date in my form, run the quaery which will list all people who have Attended A,B or CWhen I do my normal query, I put the fields in, but if I put a date filter in Event A, it will not show up any person who may have attended event B but not Event A.I thought about running an append query but this would mean running the data several times with possible duplication of client names.Ideally I would like to have my report to showDate: 31/07/2006Name A B CK.Brown Y YJ Blogg Y YK Smith YK Ellum Y Ythen I can just use a count at the bottom :)The methods I have tired will filter event date A, but will not show J BloggIf I create another append for Event B, and append that data to a table, then I will have duplicaion of K Brown.. Any Help Appreciated.Last thing - when I run the append queriy and get my duplications, the fields where I had a Y/N option - if it was YES then I get a -1 instead of 1 ??? Why? and how do I make sure that when appending that the Y answer is a 1 not a -1
Hi, I am having a problem using the combo boxe, I think it is an easy problem but I have been spending the all morning trying to find a solution with no success. i am designing a form allowing to enter the different costumer information in our system. The costumers information are broke down in 2 tables TblCostumer and TblCostumerOffice where a single costumer can have many offices across the world. The form shows the main costumer with a subform showing the different offices location. I wanted to use a comboxe on the main form allowing the user to go on the specific costumer page selected, I am just working with 2 fields for now CostumerID and CompanyName. The combo boxe is bound to CostumerID and is not allowing any change, I don't know if it is the right method because I would normally use combo boxe to change a field value not find a specific record. Should i use code in the after update event using the 'gotorecord' or 'findrecord' command?
I have a form with a subform which has a lookup table (combo box) as a field. I want to be able, when I select a certain item in the lookup to have it automatically open a form. e.g. A field called insurance class - I select motor, I want the motor details form to open. If I select Fire, I want it to open the fire form and so on. I have already created the forms. Please help!
I've attached a sample database. In this database, I'd like to have the combo boxes under the Week Ending label populate the data for the fruit name to the left of each box. For example, if I choose Week Ending 2 in the box next to Banana, I'd like to have the boxes to the right of the combo box auto populate with the data in the table. I already have started some coding, but I'm not getting what I want to see.
Here's the problem: the codes will only display the top row of data in the 9-7 and 9-14 tables, respectively. That is, if I choose week 2 for Banana and week 2 for Orange, the numbers that populate will be the same. Instead of this, what I would like to see happen is that if week 2 is selected for Orange, then have the second row of data, from the 9-7 table, populate into the textboxes on the Products form.
I need to print a specific form based on the selection made on a combo box.
I have been able to set it up to open the relevant form when the user selects an option from the combo box, but am unable to find a way to be able to print the specific report based on the selection.
I have a command button which prints a report based on the data in my current form, but would like it to also print the specific form based on the combo box selection.
I have a combo box that I normally type the start of a Surname and it auto drops down from underlying database ID is now show in col count, only 1st two.
Surname Name ID jones/k kelly 33333 smith/m max 12345 smith/m monty 98765 white/t tom 55555
smith/m will short list to the two above, I can mouse click or arrow down to the 2nd one Press enter & its knowa the corresponding ID (= surname.Column(2)) and goes to the correct record.
What I am trying to do, is from another part of my program, eg an incoming email with the corresponding Surname, Name & ID Automatically go to this main booking form, auto enter surname "smith/m" - which is fine, the list shortens but It goes to the first matching on the list, ie max.
Is there a way to get it to go to monty using the ID 98765 which is unique.
Perhaps an odd request but actually nice to book each time through this same main form, I actually also want it to do the same from incoming phone calls, It can get the unique ID ok but can see a way for the combo box to jump to the correct & only row from underlying register.
Bit worried about trying to change the underlying select statement that the combo seems to be based on, perhaps this is the way forward but not sure how to do this & don;t want to risk messing the most important & already functioning well normal entry style.
I need a query that calculates a date that is the first of the month following a specific date. Example: The first of the month following the 65th birthday.
Hello all...New to Access & still crawling under the tables....So any help is most appreciated.
I have a table w/ a field named 'Week Ending'....The 'Week Ending' column is based on each Friday's date, and may contain anywhere from 5 - 30 entries per Week End date.
Now for the simple question I'm obviously missing the answer too...I have a query that I run weekly based on the entire record set for the 'current' week ending.
My last set is obviously 1/26/2007. Is there anyway to make the most recent week ending date the default criteria for the record set; instead of changing the query design each time? It may seem trivial to some, but I just want to cut any step possible for any additional users..
I need a query that calculates a date that is the first of the month following a specific date. Example: The first of the month following the 65th birthday.
I was wondering how I could select a date for a particular field in my main form. What I'm trying to do is this: When I make a particular selection in one of my fields, I need to be able to specify a date that will be displayed on the main form, and also print on the report. I need to be able to select a specific date, and not a default date.
Hope this is clear, trying to keep it simple - which can be pretty complex.
I am looking to calculate in a form someones age in years and months at a specific date.
I have tried various different functions but can't seem to work out where i'm going wrong.
The persons date of birth is entered manually into the "DoB" field. I then want their age to be calculated in a text box below this, if it needs 2 text boxes then so be it.
The specific date is 25/05/2007 (UK date).
I am currently using the datediff function but I need the calc to be more specific than just the year.
I have a form which runs specific queries and opens a report using combo boxes, these work perfectly fine if I just try to run them in the form. I have put the form into a navigation form and if I try to run the same query I get parameter queries popping up instead of just running the query and opening the report.
hi, i have certain jobs and i want to select them based on the job date.
in my current query, i use the job date parameter [Enter a Date:]
when the user types in the date, then the jobs for that date and their corresponding information is displayed.
however, i have created a form for this query displaying the results as a datasheet.
instead of the user having to enter the date for the query manually, is there any way to modify the query to only show results for the current day.
eg. today is the 24/02/06.. so i would like the results from the query to automatically show the jobs for that date. this way, only todays jobs will be shown in my form.
Hi all, I need to extract in a query a recent range of records, these records should be all before a certain date and all the following future records example: if today date is 12/12/2007 I need to extract all records that are dated from the 1st of november and all the records that come after the 12/12/2007. In the criteria I have set "Date()" what else should I be adding to get the range mentioned above? Thanks