Hello, please could anyone tell me if is it possible to have a combo box in a form that displays just the last 7 days? (from whatever today’s current day is) I need to be able to store this date that the user selects in a query/table
(Currently I have a field named SHIFT_DATE that the user enters a date into this field, this field is bound/linked to a query)
Ie a drop down list showing the dates like this:
15/02/2006
14/02/2006
13/02/2006
12/02/2006
& so on……
ive used the following code in a query before to display records from just the last 7 days
>=DateAdd("d",-7,Date())
I thought maybe I could do something similar in a combo box but I’ve had no luck so far :-( any suggestions would be excellent. Thanks.
I have been designing a database and finally was making good headway. I have a junction table that references 2 tables (1-m) and the junction table creates an autonumber primary key that many tables will reference. I realized that the junction table could have duplicates. I did not want to use a composite primary key, but found that I could create an index that contained the unique combination of my foreign keys. No more duplicates. I thought things were looking up. I found out that it is a bad idea to use a combo box in dataset view to have look-ups to other tables. If it is a bad idea why have the option? It does make data entry easier. Anyway not my question. The other tables that refer to my junction table no longer show the values of the foreign keys, but displays an id number for my 2 columns.
I have created a combo box on a form using the combo box wizard. The combo box is linked to a table, and the combo box user's selection is supposed to be entered into a table so I can use it in reports, etc. The form works great. However, when I go to the table field that is supposed to have the newly entered combo-box selection, it contains only the record number, not the field contents chosen (by-the-way ... the record number and the record ID are the same ... maybe it is showing the ID??) Either way, why won't the table show the correct user choice from the form?
How do I get my combo box selection to display related results in a list box? I have a many to many table structure for a contact list that relates many contacts to many costcenters. What I want is when the user selects a costcenter from the combobox the related contacts show in a list box.
I need to add new records to a table depending on what the cbo box displays. I figure this is the way to do it but I it's not working, I have only writen the first select,
Private Sub Comando6_Click() Dim dbPalavraChave As DAO.Database Dim rstchaveCFEPC As DAO.Recordset Set dbPalavraChave = CurrentDb Set rstchaveCFEPC = dbPalavraChave.OpenRecordset("chaveCFEPC")
I'm trying to use an Invoice number from an Invoice form to populate a table of Invoice Lines with relevant records (linking by Invoice number). I realise the following SQL code isn't an append query, but I've simplified it to make it easier to explain
SELECT [Forms]![fInvoices]![SPInvNumber] AS MTInvNumber, tInvoices.SPInvNumber FROM tInvoices WHERE (((tInvoices.SPInvNumber)=[Forms]![fInvoices]![SPInvNumber]));
The output I get for this query is something along the lines of:
MTINvNumber | SPInvNumber 쉠 | 49760
THe MTInvNumber should read the same as the SPInvNumber, but it doesn't. If you can't see the above, its some sort of weird chinese/japanese character I think!
I thought maybe it was a display error, but I tried using it in my append query, and it inserted it as garbage too. The weirdest bit is it actually regards the form information as equalling the SPINvNumber from the tInvoices table! :S
Any clues on how I get it to format correctly??? I'm very tired now so it's bound to be something simple!
Hello I have a small problem that seems weird. I have a form which displays a subform with all correspondending jobs for one individual. The problem is the sub form displays the main form information with the other jobs. Im trying to stop the subform from displaying the current mainform's job information. So it won't look like there are more then 1 of the same jobs to other individuals. Can someone help me with the correct method to stopping this. Thanking you in advance,
I have a form, with a sub-form, which worked fine. but now, after I added and changed around the options in a combo box in the sub-form my main form only shows one result.
Hey guys, I was wondering... is there a way to have a listbox display values associated with a parent form ID? in other words... say I have a customer with invoices associated with their name, I want to display a form for that customer with a listbox (or maybe even subform) containing the invoice IDs associated with their name. Right now, I've got: SELECT qryClientData.InvoiceID, qryClientData.InvoiceDate FROM qryClientData ORDER BY [InvoiceDate]; to display information in the listbox. How do I modify this to display ONLY Invoices associated with the Clientname on the parent form?
I hope this makes sense. I can clarify if need be, I am just completely stumped. thanks and happy holidays!
I have made a search form for my company, where all the data is put simply into the tables and i have made a search form to search with the selected fields, it was working at first, but now it just displays blank table when i search.I am using ms access 2007.Here is the sql of the query::
I have a form with a subform in it. On the main form, I have a combo box with a list of program numbers to choose from. Once one is selected, the subform displays all the unpaid invoices under that program number. This part works fine. The problem occurs when I try to close the form, switch to design view, or scroll the subform to the right. Basically, the error message says that the record can't be saved because it would create a duplicate value in the index/primary key. However, this form is used to display information only. I have disabled the edit, delete and addition abilities, so I can't figure out why it thinks I am trying to change or add a new record. Any help would be appreciated.
I figured it might make things easier if I included a copy of the database, so here it is.
The form is called SETR, and the subform is AllInfo subform.
why access 2007 is displaying an image oddly on a 2003/2008 terminal server farm. I am reasonably sure the problem is an access on terminal server issue because if you view the image in paint, image viewer, or word it displays fine on the terminal server. I don't think it is a resolution or color issue because once again it displays fine in paint, etc regardless of color depth.
The image below shows the difference in the png graphic. The image is transparent (the blue section being the background)
[URL]
As you can see the terminal server image is pixelated.
The form the image is sitting on has a blue gradiant that goes light to dark left to right. The form properties are below
I have problem with my code here. I am using this code to determine if the LogDate with a weekday of Sunday can be declare as Sunday Work or Regular Work. The 1st week of my entry can determine if the LogDate is Sunday then compute if it reaches a 7 days working, if he is absent even 1 (one) day in his previous working days within the week. His Sunday LogDate is considered as Regular Days instead of Sunday Work. Can anyone tell me what is wrong in this code?
The problem here is the computation of 7 days after 1 week. There should be a 7 days computation every week per month in able to declare Sunday Work or Regular Work. I tried this code but it did not work on 2nd week, 3rd week and 4th week of the month.
How come on 2nd week, Sunday (LogDate) is not considered as Sunday Work even he completed the 7 days (working days) per week? I need help on this ASAP Thanks
Tim
Below is the code i'm using for defining Regular days and Sunday Working Days:
Private Sub LogDate_AfterUpdate() Dim rst As DAO.Recordset, rs As DAO.Recordset Dim db As DAO.Database Dim dteToday As Date, dtePrior As Date Dim i As Integer
Set db = CurrentDb Set rst = db.OpenRecordset("SELECT [HolidayDate] FROM tblHolidays", dbOpenSnapshot)
rst.FindFirst "[HolidayDate] = #" & dteToday & "#" 'See if the date entered is a holiday If rst.NoMatch Then Holiday.Value = 0 Else Holiday.Value = 1 End If If Weekday(dteToday) = vbSunday Then 'If dated entered is a Sunday determine if Dim strSQL As String 'it will be a regular day or a Sunday
I have a form where a start date is inputted (Inputfrm , StartDate) and a form where the end date of the process is recorded (Inspectionfrm , EndDate) and these both record in the table InputTbl as StartDate and EndDate respectively.
I have created a union query which shows a list of all the dates where there is work recorded (WorkingDatesQry and the column of list of unique dates is "WorkingDate"), and as we run a highly varied schedule depending on time of the year and order numbers I cannot just use a query which says Monday-Friday or Tuesday - Saturday.What I am trying to do is to find the number of days between StartDate and EndDate where there is a date recorded in the WorkingDates query.
Client has asked me to create a report showing summary of monthly sales by day. That was easy. I created a query for the month the user selected and then summarized and group the data by day. Client like the result but would like to see zeros on the report for non sales days. Non sales days are days like holidays and there are no sales.
I am thinking of creating an table with 31 days of zero values and then join the two tables in a query? Or, should I create a temporary table with code and then merge the two tables which the existing query which I can then use for the report?
I have a query and I need the records to display 3 working days before the 15 working day deadline.
I used the following in the criteria box below the received date field and it doesn't pull the correct number of workdays, it's pulling calendar days instead.
I have a query and I need the records to display 3 working days before the 15 working day deadline.
I used the following in the criteria box below the received date field and it doesn't pull the correct number of workdays, it's pulling calendar days instead.
I rent out a property , on the rental statement I have a field [Datepaid], [RentpaidFrom] and [rentpaidTo]. I would to have a field that can calculate the rent that is paid to show if the rent is in arrears or in Advance. I guess the code would be something like (datediff ???? etc) but i have no idea what it should be. the calculation should appear on the query as i.e.2 days in arrears or 12 days in advance etc
I'm new to VBA coding. A code below is copied from a friend of mine and I can't make it work. How to call up this function in my form. In my form I have 3 text boxes (StartDate, EndDate and NumOfWorkDays). My form is based on a table.
Please anyone who would help me on this, kindly give me the step by step procedure as I am really novice. Thanks in advance.
'*********** Code Start ************** Public Function WorkingDays(StartDate As Date, EndDate As Date) As Integer On Error GoTo Err_WorkingDays
Dim intCount As Integer
StartDate = StartDate + 1 'If you want to count the day of StartDate as the 1st day 'Comment out the line above
intCount = 0 Do While StartDate <= EndDate 'Make the above < and not <= to not count the EndDate
Select Case WeekDay(StartDate) Case Is = 1, 7 intCount = intCount Case Is = 2, 3, 4, 5, 6 intCount = intCount + 1 End Select StartDate = StartDate + 1 Loop WorkingDays = intCount
Exit_WorkingDays: Exit Function
Err_WorkingDays: Select Case Err
Case Else MsgBox Err.Description Resume Exit_WorkingDays End Select
Hi I have a Text box that stores a date of when a problem or query is received on to a customer account, when resolved the date it is resolved is inputted in the next text box as a resolved date. My third Text box then needs to display Yes or No depending if it took less than 28 days to resolve.
Ive used a Text box and DateDiff expression to work out the ammount of days in the control source, Called query dauration then a macro to test if its less than 28 days to display the yes or no. But this is not working days Mon - Fri. Has any one any ideas?
Anyone help please ? I'm still fairly new to ACCESS so forgive me if I'm completely on the wrong track !
I wish to add a control button to a form that will prompt me to enter a date and then calculate and display a date nn (fixed) number of WORKING days in the future.
I've seen some functions suggested in the forum and as I'm unfamiliar with this topic, I have tried putting together some code (see below) related to an On Click event for the button. I'm having syntax problems and have been battling away at this for some time without success.
Suggestions please !
Steve
Private Sub cmdDate_Click() Dim FirstDate As Date ' Declare variables. Dim Number As Integer Dim dtEndDay As Date Dim dtinterimday As Date Dim intcount As Integer Dim lnginterimdate As Long Dim intdays As Integer
Dim Msg FirstDate = InputBox("Enter a date - dd/mm/yy") Number = 20
dtinterimday = FirstDate intdays = Number Do Until intcount = Abs(intdays)
If intdays > 0 Then dtinterimday = dtinterimday + 1 Else dtinterimday = dtinterimday - 1
lnginterimdate = dtinterimday
If WeekDay(dtinterimday, 2) <> 6 And WeekDay(dtinterimday, 2) <> 7 Then
intcount = intcount + 1 End If End If
Loop
Msg = "New date: " & dtinterimday MsgBox Msg End Sub
Hi I have 3 date fields. I am trying to work out number of days when
=[FIELD1 - FIELD2 OR FIELD3]
should do the calculation in field 4 NUMBER OF DAYS. but it comes up with date only. FIELD1 will always be filled, if field 2 is field then the number of days must be based on that. but if field2 is blank then it should be field1 - field 3. I may need a help on the formula does it need any if, else statement or not. If so can someone please help