Checking For Date In Access File And Compairing It To Todays Date...
Hey all, i am stuck at this point in my program.
I need the program to load up my access table and check for the date of orders:
each record has a field called PickUp and its formatted like "sat 1/1/2004".
When the form loads up, i need it to check that field and the computers date and if its the same, place the record into the list view. Keep going down the list til EOF.
Any help would be great.
Thanks for your time, David
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Resolved -How Do I Get Tomorrows Date From Todays Date And Put It In Access An Query?
- Compair Todays Date To A Date On File
- FIXED!!! Display Todays Date <Access>
- Still Having Probs With Select Statement Where Date = Todays Date
- Creating A Text File With Todays Name And Date
- Problem With SQL Date Query (Todays Date)
- Q.1 - Adding Todays Date To The Write File When Saving And Q.2 - Appending
- Go To Todays Date Row
- Todays Date
- File Information Get Path ,filename,filesize,access Date ,modified Date
- How Do I Insert Todays Date Using Sql
- Doesn't Seem To Like Todays Date
- List ALL Files For Todays Date
- Saving Textbox With Todays Date
- Adding Days To Todays Date
- Inserting Todays Date With Button
- Saving Text With Todays Date
- Reading Todays Date / Display Data
- Monthview DayBold Works, But Resets To Todays Date.
- Archive PPT-Save A Copy With Todays Date, If Doesnt Exist Already
- Checking Date Of File Via FTP
- Checking For Conflicting Date/Time In Access Database
- Checking Between Date VB And Date SQL Server
- I Need To Access Date From A Data Base And Manipulate The Date Once I Get It.
- Date Files > Read Them Backwards From First Date > Access
- Validating Server's Date Against A Date In An MS Access Database
- Saving A Text Box As Text With Todays Date
- DATE Problems - Change Date Format To European, Get Current Date, Subtract 2 Dates?
- DATE Problems - Change Date Format To European, Get Current Date, Subtract 2 Dates?
- How To Subtract 12 Date And Then Delete All The File Match The Date
- Comparing User Inputed Date With File Date
- Every Record Has A Date Field. I Want To Find A Date And From This Date, I Want To Read Records To E
- Get Date Created And Date Modified Of A File
- Comparing SQL Date And Access Date
- DATE Problem - Formatting US Date MM/DD/YY To European Date Format DD/MM/YY
- Query With Date Ranges And Return Only Closest Date To 'to Date'
- DATE Problem - Formatting US Date MM/DD/YY To European Date Format DD/MM/YY
- Change Last Access Date Of File
- How To Access The Last Modified Date Of A File Using VB
- Turning MS Access File Into .exe Using VB6 With Expiration Date
- Querying Ans Access File Based On Date
- Checking Date
- Date Checking
- Help Checking A Date
- Getting The Binary Output From A File Without Changing The Access Date
- Displaying File Last Access Date And Created Info
- Checking To See If User Changes Sys Date - How?
- Checking For Date Type!
- Checking For A Date Format
Compair Todays Date To A Date On File
Code:
Public Sub CheckExpire()
sb.Panels(1).Text = "Checking For Expired Membership!"
Dim B
Dim A
B = 1
A = 1
Do
If sb.Panels(2).Text = list.TextMatrix(B, 5) Or sb.Panels(2).Text > list.TextMatrix(B, 5) Then
If list.TextMatrix(B, 1) = "" Then
Exit Do
Else
Form2.Show
Form2.list.TextMatrix(A, 1) = list.TextMatrix(B, 1)
Form2.list.TextMatrix(A, 2) = list.TextMatrix(B, 2)
Form2.list.TextMatrix(A, 3) = list.TextMatrix(B, 3)
Form2.list.TextMatrix(A, 4) = list.TextMatrix(B, 4)
Form2.list.TextMatrix(A, 5) = list.TextMatrix(B, 5)
Form2.list.TextMatrix(A, 6) = list.TextMatrix(B, 6)
B = B + 1
A= A + 1
End If
Else
B = B + 1
End If
Loop
A = A - 1
sb.Panels(1).Text = "Check Complete, " & A & " Found To Be Expired!"
End Sub
Humm? 0 Found, I Added 1 With A Expired Date, Ideas?
Edited by - catacomb on 8/29/2003 11:00:16 AM
FIXED!!! Display Todays Date <Access>
< edit > I got it working...
How do assign today's date to a text box? I tried searching around here before posting a simple question.
Here is what I have:
Code:
Private Sub order_date_BeforeUpdate(Cancel As Integer)
order_date.Value = Date
End Sub
Edited by - SubPar_Coder on 9/15/2004 3:00:46 PM
Still Having Probs With Select Statement Where Date = Todays Date
Hi Guys
I am using vb6.0 connecting to a SQL database (runningMSDE)
I am trying to load all contacts where the recontactdate is today
I have tried the following but am getting the error - syntax error converting datetime to character string - please help!
my code -
onload - dtpicker1.value = date
(tblcontacts.dtmrecontactdate is date/time)
Set adoduecallbacks = New Recordset
adoduecallbacks.Open "Select * from tblcontacts where dtmrecontactdate = ' " & DTPicker1.Value & "%" & " ' ", db, adOpenStatic, adLockOptimistic
- Please help!!!
Thanks
Problem With SQL Date Query (Todays Date)
Hi there,
Having a problem getting an SQL query to work when searching a database for todays date (basically a reminder package).
Here's the query
Set MyRecSet = MyConn.Execute("SELECT CoxRef, CompanyName, ContactName, postcode, tel FROM Reminders WHERE ReminderDate = #(date)# ")
Have tried all sorts of different things such as '&(date)&'") etc.
Only works when I type the date in like so .. WHERE ReminderDate = 15/02/2005
Any ideas please ?
Seymour
Q.1 - Adding Todays Date To The Write File When Saving And Q.2 - Appending
I would like to know if I could add a statement to the write command somewhere in the following code, so the file would write Todays date at the end in date format MM/DD/YY:
As the text in my write file looks like this:
"Flower - Lilac",2,5.22,10.44
Could I get it to add TODAYS date automatically to read
"Flower - Lilac",2,5.22,10.44,03/07/04
My code now reads:
**************************************************
Private Sub cmdWriteQuotation_Click()
Dim pintCurrentItem As Integer
Dim pstrFileName As String
Dim psngTotal As Single
pstrFileName = _
InputBox("Enter the filename", "Write File")
If pstrFileName <> vbNullString Then
Open pstrFileName For Output As #1
For pintCurrentItem = 0 To _
lstQuotedExtPrice.ListCount - 1
Write #1, _
lstQuotedProduct.List(pintCurrentItem), _
Val(lstQuotedQty.List(pintCurrentItem)), _
Val(lstQuotedPrice.List(pintCurrentItem)), _
Val(lstQuotedExtPrice.List(pintCurrentItem))
Next
psngTotal = 0
For pintCurrentItem = 0 To _
lstQuotedExtPrice.ListCount - 1
psngTotal = psngTotal + _
lstQuotedExtPrice.List(pintCurrentItem) * 1.06
' Above line computes Sales Tax directly into total
Next
txtTotal.Caption = Format(psngTotal, "Currency")
End If
Close #1
End Sub
****************************************************
Also, when I pull this data into an Access Table it leaves the .44 off the total price of 10.44 as from the line below: why?
"Flower - Lilac",2,5.22,10.44 (It pulls the 5.22 just fine, but the 10.44 it gives me 10)
Also someone told me how to append the write file here earlier by using the Append command with the For statement, but can't get that to work...could someone give me a clue how to change this Statement to append all new input to the same text file.
My existing code is above and if you can show me how to use the append command I'd sure appreciate this too...
Thank you
NMP
Go To Todays Date Row
Hi-
I was wondering if anyone could help me write a macro that when clicked on would take the user to todays date.
My spreadsheet is set up with every date from now until 2010 on the left column.
I want a feature where you click on a button an it takes you to (maybe even highlights that row) the current date.
Any help would be appreciated. I have never used VB or macros before.
thx
matt
Todays Date
is there a way to have a caption display todays date?
File Information Get Path ,filename,filesize,access Date ,modified Date
This tiny zip file have filename,filepath,fileaccess date,file modified date
if picture file then size of the picture
Thanks guys
bellow code
-------------------------------------------------------------------
Private Const OF_READ = &H0&
Private Declare Function lOpen Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long
Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long
Dim lpFSHigh As Long
Private fileN As String
Private fileP As String
Private fileS As Double
Private fileC As String
Private fileA As String
Private fileH As Long
Private fileW As Long
Private fileX As String
Dim fs As Scripting.File
Private Sub Command1_Click()
Call commonDialogCall
Call GetFileS(fileX)
Call FileWHget
Call FileDateGet
Call displayall
End Sub
Public Sub displayall()
Label1.AutoSize = True
Label2.AutoSize = True
Label3.AutoSize = True
Label4.AutoSize = True
Label5.AutoSize = True
Label6.AutoSize = True
Label7.AutoSize = True
Label1.Caption = "File name = " & fileN
Label2.Caption = "File path = " & fileP
Label3.Caption = "File size = " & fileS & " Byte"
Label4.Caption = "File Created = " & fileC
Label5.Caption = "File Accessed = " & fileA
Label6.Caption = "File height = " & fileH
Label7.Caption = "File Widht = " & fileW
End Sub
Public Sub commonDialogCall()
CommonDialog1.Filter = "*.bmp"
CommonDialog1.ShowOpen
fileX = CommonDialog1.FileName
fileN = CommonDialog1.FileTitle
fileP = Left(CommonDialog1.FileName, Len(CommonDialog1.FileName) - (Len(CommonDialog1.FileTitle) + 1))
End Sub
Public Sub GetFileS(FilePath As String)
Dim Pointer As Long, sizeofFile As Long
Pointer = lOpen(FilePath, OF_READ)
'size of the file
sizeofFile = GetFileSize(Pointer, lpFSHigh)
fileS = sizeofFile
lclose Pointer
End Sub
Private Sub FileDateGet()
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(fileX)
fileC = f.DateCreated
fileA = f.DateLastModified
End Sub
Private Sub FileWHget()
Dim pic As Picture
Set pic = LoadPicture(fileX)
fileH = pic.Height
fileW = pic.Width
End Sub
Private Sub Command2_Click()
End
End Sub
---------------------------------
How Do I Insert Todays Date Using Sql
I have an access table and I want to insert today's date into one of the field. What is the correct syntax.
This is not working:
Dim todaysdate as String
todaysdate = format(Now,"m/d/yy")
Insert into table(Date)Values(todaysdate)
Thanks
List ALL Files For Todays Date
Hi,
Can someone please help me with the following request.
I wish to list all file names on my hard disk that have a last accessed/modified date of today - this includes all subdirectories
from the root directory.
Thanking you in advance.
Cheers,
Kevin
Saving Textbox With Todays Date
I am trying to save the text in a textbox with the with the current date automatically updated every day by simply clicking a button
This is what I have but it doesnt work
visual basic code:--------------------------------------------------------------------------------Public Function SaveText(Text1 As TextBox) As Boolean
Dim hFile As Integer
Dim sFileName As String
On Error Resume Next
hFile = FreeFile
sFileName = App.Path & "C:" & Format(Now, "yyyymmdd") & ".txt"
Open sFileName For Output As #hFile
Print #hFile, Text1.Text
Close #hFile
End Function
Private Sub Command1_Click()
Call SaveText(Text1)
End Sub
Private Sub Text1_Change()
End Sub
--------------------------------------------------------------------------------
Adding Days To Todays Date
I want to add x amount of days to todays date. The number of days is held in an integer variable...how would i do it????
Inserting Todays Date With Button
I am v new to this VBA lark so be kind :-)
I have three cbo's - dd, mm, yyyy and what I want is a button next to the date dropdowns so you can click 'today' and it fills out the dd/mm/yyyy with todays dates.
I currently have this cbo code :-
With cbodd
.AddItem "01"
.............
.AddItem "31"
End With
With cbomm
.AddItem "January"
.............
.AddItem "December"
End With
With cboyyyy
.AddItem "2004"
.............
.AddItem "2008"
End With
Any help/pointers very welcome!
Thanks
Pete
Edited by - petebrooker on 6/22/2004 10:10:00 AM
Saving Text With Todays Date
I am trying to save the text in a text box as for example "20050511.txt" for todays date. I want the date to update automatically and I want the file to save when I click a command button.
Please help if you can
Reading Todays Date / Display Data
I'm writing a small address program and wish that it will display a list of birthdays/anniversaries that are happening 'today' when the form loads.
As I have the control version of VB I am unable to read from a database, so I thought that I would just list them - but can I get VB to read a list and recognise 'todays' date?
A direct to research would be helpful, Cheers
Monthview DayBold Works, But Resets To Todays Date.
This is a pretty easy task I think, but I wanted to run this by everyone on the forum.
My program revolves around a monthview control. The user clicks the date they want to work with and off they go. What I'd like to do is have the monthview control show the days in bold where data has been entered into the database. That way the user can see at a glance (one month at a time) where they've entered data.
I think the easiest way to do this is to find the first and last day of the month their working in then run a query that selects distinct dates from the database where they fall in between the first and last days of the month. At that point I can loop through and say if there is a match, bold the day...if not, move to the next day.
So I guess all I need is how to find the first and last days of a month based on where the user is currently sitting in the monthview control.
Checking Date Of File Via FTP
is it possible to log on to a password and username protected FTP website and get the date and time a particular file was last saved there? if so how? any help will be much appreciated
Checking For Conflicting Date/Time In Access Database
I have a program that will allow a user to enter Dates and Times for Appointments that popolulate an Access Database.
Now I need to add code to no allow for conflicting appointments. All appointmetns are 1 hour and I'm having trouble figuring out how to have the program check the tables for conflicting dates and times when the appointment form is updated.
I know the logic needs to be that it should first check for matching dates and then check for the time range.
Any suggestions?
Thanks.
Checking Between Date VB And Date SQL Server
I am trying to check a vb date against a SQL Server 2000 date but it doesn't bring me results.
My DateOfBirth value is "dd-mm-yyyy" and my SQL Server columntype is smalldatetime.
My sub is:
Code:
Public Sub checkLeerling()
On Error GoTo Errs
Dim rsLeerling As Recordset
Dim strSQL As String
strSQL = "SELECT Achternaam, Geboortedatum FROM tblLeerling WHERE LOWER(Achternaam) ='" & _
Trim$(LCase(mudtProps.Achternaam)) & "' AND CONVERT(datetime, Geboortedatum , 105)= " & mudtProps.Geboortedatum
Set rsLeerling = New Recordset
rsLeerling.Open strSQL, cnDI, adOpenStatic, adLockReadOnly
MsgBox rsLeerling("Geboortedatum")
If Not (rsLeerling.BOF And rsLeerling.EOF) Then
RaiseEvent LeerlingBestaatAl
Else
RaiseEvent LeerlingBestaatNiet
End If
rsLeerling.Close
Set rsLeerling = Nothing
Errs:
Debug.Print Err.Number
Debug.Print Err.Description
End Sub
mudtprops.Geboortedatum looks like this:
Code:
Public Property Let Geboortedatum(Value As Variant)
If Not mflgEditing Then Err.Raise 383
If Len(Trim(Value)) = 0 Then
mudtProps.Geboortedatum = ""
mobjValid.RuleBroken "Geboortedatum", True
ElseIf IsDate(Value) Then
mudtProps.Geboortedatum = CVDate(Value)
mobjValid.RuleBroken "Geboortedatum", False
checkLeerling
Else
mobjValid.RuleBroken "Geboortedatum", True
End If
mflgDirty = True
End Property
Public Property Get Geboortedatum() As Variant
Geboortedatum = mudtProps.Geboortedatum
End Property
Anybody has an idea why my check on this date doesn't work? Checking purely on the LastName of a student it works perfectly but it needs to check on the date of birth too.....
Kind regards,
Richard
I Need To Access Date From A Data Base And Manipulate The Date Once I Get It.
I created a program using perl that can preform some basic math on some user entered data. The program uses other numeric data to preform calculations on the user data. The problem is that from time to time non computer users will need to change the numeric data that effects the user input data. I would like them to be able to make the changes and have the program store the changes as variables to work on the user input with. They may update an excel file for instance then the numbers in the fields could be imported to be used by the program to operate on the user input data. Does anyone have a clue if I can accomplish this using Visual Basic 6?
Date Files > Read Them Backwards From First Date > Access
all,
i posted a question on the access database forums,
http://www.tek-tips.com/gviewthread.cfm/lev2/4/lev3/27/pid/701/qid/581404
but i believe this is going to be a visual basic application of some sort.
basically, i want to create a button on my switchboard that will look at the dates in my table and from the last date entered (or the newest) it will add 7 years to it, from the computers clock.
from here, i can create a query that will delete these (e.g. newest date + 7 years (from first date to computers date) = purge)
does anyone have an idea on how i should go about this? i figure its not going to be a few clicks and lines of text... but something more complicated.
thanks all,
Luke
Validating Server's Date Against A Date In An MS Access Database
I'm trying to redirect a user based on what date the field "expires" in my MS Access 2K DB has - This section is where I want to redirect to a page if the expires date in my database = today.
I'm selecting the table above ( rsUser.Source = "SELECT user_username, user_password, expires" ) but I don't think that the Sub is written right.
Sub currentDate
currentDate = Date
If expires = Date Then
redirectLoginSuccess = "expiretoday.asp"
End If
End Sub
I'm new to VB; the ASP page I'm calling this through just skips this routine - which means I didn't do it right. Any suggestions?
DATE Problems - Change Date Format To European, Get Current Date, Subtract 2 Dates?
Need someone to point me in the right direction/start me off with this please as I am quite clueless on it at present...
I need something that can successfully subtract two dates...
eg. calculate the difference between the current date
02/04/04 (2nd April 04) and 29/03/04 (28th March 04)
...
which will then output a result of 5 days
So what I need to know is...
1.
I need to know how to get the current date from the system clock
2.
I must somehow get my date function converted into European date format (as at present it is in USA format ie. 2nd April 04 is 04/02/04 like April 2nd 04 which is not good!)
3.
and then I must actually SUBTRACT the 2 dates (the current date and a date that is given) from each other to give an integer which I can then use (ie. a value like 5 or 15).
But I have little idea how to go about this
Can anyone please start me off?
DATE Problems - Change Date Format To European, Get Current Date, Subtract 2 Dates?
Need someone to point me in the right direction/start me off with this please as I am quite clueless on it at present...
I need something that can successfully subtract two dates...
eg. calculate the difference between the current date
02/04/04 (2nd April 04) and 29/03/04 (28th March 04)
...
which will then output a result of 5 days
So what I need to know is...
1.
I need to know how to get the current date from the system clock
2.
I must somehow get my date function converted into European date format (as at present it is in USA format ie. 2nd April 04 is 04/02/04 like April 2nd 04 which is not good!)
3.
and then I must actually SUBTRACT the 2 dates (the current date and a date that is given) from each other to give an integer which I can then use (ie. a value like 5 or 15).
But I have little idea how to go about this
Can anyone please start me off?
How To Subtract 12 Date And Then Delete All The File Match The Date
Hi all,
At the first run on my program, I rename all incoming file within today date. then now my folder start to be full after a while. i mean my output folder is full.
how can i delete a list of file if they are 12 day old?
here is my rename and adding todays date.
thanks for u help in advance.
my output file after renaming looks like : myfilename.txt-07-07-2007
Code:
Private Sub tmrRefresh_Timer()
File1.Refresh
File2.Refresh
Dim i
Dim oldFileName$
Dim filedate$, newFileName$
Dim oldFilePath$
Dim del
Dim newfilename1$
filedate$ = Format$(Now, "dd-mm-yyyy")
For i = 0 To File1.ListCount - 1
oldFileName$ = File1.List(i)
If oldFileName$ <> "Rename1.exe" Then
oldFilePath$ = File1.Path & "" & oldFileName$
newFileName$ = File2.Path & "" & oldFileName$ & "-" & filedate$
If oldFileName$ <> "" Then
FileCopy oldFilePath$, newFileName$
Kill oldFilePath$
End If
End If
File1.Refresh
File2.Refresh
Next i
End Sub
Comparing User Inputed Date With File Date
Hi
Can someone please help me out of this....
i'm making the user input the date in a textbox in the same format as the date format of a file's "last modified date". i need to add all those files to a listview whose last modified date is less than or equal to the user input.
Really appreciate it......
Ice
Comparing SQL Date And Access Date
this is what ive done:
strQuery = "SELECT * FROM Table WHERE Date1 = '%/" & strYear & "'"
ive tried putting #%/" but it gave me a syntax error. my date in Access would be in short date...does it matter? and my output in VB Flexgrid is mm/dd/yy.
PLEASE HELP
DATE Problem - Formatting US Date MM/DD/YY To European Date Format DD/MM/YY
I have a problem whereby the user must enter a date into a field...
The system changes the date format to US standard which is MM/DD/YY
but I need to change the format to DD/MM/YY (European standard)
I have done this using the Format function, but I still have a slight problem
Format(mydate,"dd/mm/yy")
doesnt account for all dates...
for example...
if I enter 31/03/04 this is fine, it will accept it as that
However, if I enter 02/04/04 (todays date - 2nd April 04), it will change it to 04/02/04
Any ideas how I can counter this from happening?
Query With Date Ranges And Return Only Closest Date To 'to Date'
I am using an access db...
I am trying to pull back due dates for credit reports for clients. I have 4 tables I am working with for this query...
[Client_info]
[Dispute_track_eq]
[Dispute_track_exp]
[Dispute_track_trans]
[Client_info] has the basic client information....ID, SSN, name, telephone_numbers, yadd yadda..
each of the other tables hold the fields I am pulling from(other fields as well but these are the ones i need)...
[Dispute_track_eq].eq_due_date
[Dispute_track_exp].exp_due_date
[Dispute_track_trans].trans_due_date
Here is my problem...
I have variable that are set by dtpickers...'from_date' and 'to_date'. I am trying to get back each of these due dates that fall between the ranges set along with the [client_info] data linked by the SSN field. The problem is that sometimes these clients will have multiple due_dates(multiple rows) between the range. What the end result needs to be is this, I need to only have one record to come back with one of each due_date from each table, but only give me back the closest due_date to the 'to_date'(set by dtpicker) as well as the data from the [Client_info] table. And if there are no records for one or two but not the thirs field, an empty fields is ok(using a datagrid). But I can only pull back one row with the [client_info] fields, and one of each of the 3 due date fields. I have a query already but it doesnt even come close to working, it gives me many duplicates and doesnt give me the closest due_date to the 'to_date'.
Here is my query, but it doesnt work. Any help would be greatly appreciated, I am in dire need of help on this one.
Code:Private Sub Command4_Click() '***Due dates report grid date
to_date = dt2.Value
from_date = dt1.Value
If from_date = vbNull Then
MsgBox "Please select a FROM DATE"
Exit Sub
ElseIf to_date = vbNull Then
MsgBox "Please select a TO DATE"
Exit Sub
Else
Dim ID_new As String
Dim cn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strSQL As String
Dim ID_pass As String
Dim active As String
active = "Active-Negotiations"
Set rs = New ADODB.Recordset
strSQL = "Select" & vbNewLine
strSQL = strSQL & " [client_info].[FirstName], [client_info].[LastName], [client_info].[HomePhone], [client_info].[MobilePhone], [client_info].[Client_status], [client_info].[Category], [client_info].[Appt_notes],[client_info].[Appt_date],[client_info].[Appt_date_time], " & vbNewLine
strSQL = strSQL & " [dispute_track_eq].[eq_due_date], [dispute_track_exp].[exp_due_date], [dispute_track_trans].[trans_due_date]" & vbNewLine
strSQL = strSQL & " FROM (dispute_track_exp INNER JOIN (dispute_track_eq INNER JOIN client_info ON [dispute_track_eq].[SSN] =[client_info].[SSN]) ON [dispute_track_exp].[SSN] =[client_info].[SSN]) INNER JOIN" & vbNewLine
strSQL = strSQL & " dispute_track_trans ON [client_info].[SSN] =[dispute_track_trans].[SSN]" & vbNewLine
strSQL = strSQL & " Where (dispute_track_trans.trans_due_date > #" & from_date & "# And" & vbNewLine
strSQL = strSQL & " dispute_track_trans.trans_due_date < #" & to_date & "#)" & vbNewLine
strSQL = strSQL & " OR (dispute_track_eq.eq_due_date > #" & from_date & "# And" & vbNewLine
strSQL = strSQL & " dispute_track_eq.eq_due_date < #" & to_date & "#)" & vbNewLine
strSQL = strSQL & " OR (dispute_track_exp.exp_due_date > #" & from_date & "# And" & vbNewLine
strSQL = strSQL & " dispute_track_exp.exp_due_date < #" & to_date & "#) AND NOT NULL"
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source= " & db & " "
.open
End With
Set rs = New ADODB.Recordset
With rs
.ActiveConnection = cn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Source = strSQL
.open
End With
If rs.RecordCount = 0 Then
MsgBox "Sorry, no one matched that status, try again", vbOKOnly, "Credit Matrix"
Set DataGrid1.DataSource = rs
Else
Set DataGrid1.DataSource = rs
End If
End If
I would be forever in your debt for helping me as I am almost out of hair....FROM PULLING IT OUT!!
Edited by - ronmegga on 4/1/2004 5:26:03 PM
DATE Problem - Formatting US Date MM/DD/YY To European Date Format DD/MM/YY
I have a problem whereby the user must enter a date into a field...
The system changes the date format to US standard which is MM/DD/YY
but I need to change the format to DD/MM/YY (European standard)
I have done this using the Format function, but I still have a slight problem
Format(mydate,"dd/mm/yy")
doesnt account for all dates...
for example...
if I enter 31/03/04 this is fine, it will accept it as that
However, if I enter 02/04/04 (todays date - 2nd April 04), it will change it to 04/02/04
Any ideas how I can counter this from happening?
Change Last Access Date Of File
I have using this code to change last file date time acces/create/modify
to date created and last modify date works good, but i can't change the LAST ACCESS date. how to do set this?
See the code:
VB Code:
Private Type FILETIME dwLowDateTime As Long dwHighDateTime As LongEnd Type Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As IntegerEnd TypePrivate Const GENERIC_WRITE = &H40000000Private Const OPEN_EXISTING = 3Private Const FILE_SHARE_READ = &H1Private Const FILE_SHARE_WRITE = &H2Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As LongDeclare Function SetFileTime Lib "kernel32" (ByVal hFile As Long, lpCreationTime As FILETIME, lpLastAccessTime As FILETIME, lpLastWriteTime As FILETIME) As LongDeclare Function SystemTimeToFileTime Lib "kernel32" (lpSystemTime As SYSTEMTIME, lpFileTime As FILETIME) As LongDeclare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As LongDeclare Function LocalFileTimeToFileTime Lib "kernel32" (lpLocalFileTime As FILETIME, lpFileTime As FILETIME) As Long Public Sub ResetTimeFile(TheFile As String) Dim m_Date As Date, lngHandle As Long Dim udtFileTime As FILETIME Dim udtLocalTime As FILETIME Dim udtSystemTime As SYSTEMTIME m_Date = Now udtSystemTime.wYear = Year(m_Date) udtSystemTime.wMonth = Month(m_Date) udtSystemTime.wDay = Day(m_Date) udtSystemTime.wDayOfWeek = Weekday(m_Date) - 1 udtSystemTime.wHour = Hour(m_Date) udtSystemTime.wMinute = Minute(m_Date) udtSystemTime.wSecond = Second(m_Date) udtSystemTime.wMilliseconds = 0 ' convert system time to local time SystemTimeToFileTime udtSystemTime, udtLocalTime ' convert local time to GMT LocalFileTimeToFileTime udtLocalTime, udtFileTime ' open the file to get the filehandle lngHandle = CreateFile(TheFile, GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0&, OPEN_EXISTING, 0, 0) ' change date/time property of the file SetFileTime lngHandle, udtFileTime, udtFileTime, udtFileTime ' close the handle CloseHandle lngHandle MsgBox "The date of the file '" + TheFile + "' has been changed to" + Str$(m_Date), vbInformation + vbOKOnly, App.TitleEnd Sub
THANKS!!!!
Turning MS Access File Into .exe Using VB6 With Expiration Date
Hi,
Can someone kindlyhelp me how to make the MS Access database into .exe file using VB6 and putting a date expiration so that I can dictate how long the MS Access database can be used. Let say 1 month only.
I remember that using OLE in VB6 to link MS access database I can compile it and turn into .exe file but I forgot it already.
Many thanks.
Querying Ans Access File Based On Date
I have the following query to find a specific date in Access.
Code:
strSQL = "Select MAX([Date approved]) As Date_Approved FROM Grade Standard - Recipe] _
WHERE [Grade ID]= '" & cboGradeCode.Text & "'"
oRS.Open strSQL, oConn
If Not (oRS.BOF And oRS.EOF) Then
txtApproved.Text = Format("" & oRS("Date_Approved"), "dd-mmm-yy")
Else
txtApproved.Text = ""
End If
oRS.Close
Set oRS = Nothing
I formatted the record set for the textbox to match the format in Access.
I want to do a new query based on the date in the textbox and an ID no. in a combobox. Tried the following:
Code:
strSQL = "SELECT [Recipe Part 1] FROM [Grade Standard - Recipe] _
WHERE [Date Approved]= '" & Date_Approved & "' _
AND [Grade ID]= '" & cboGradeCode.Text & "'"""
I have two problems:
1. I get a type mismatch with Date_Approved. When I debug the error, I notice Date_Approved reads "12:00:00 AM" whereas Date Approved in Access shows "03-Dec-03". How can I resolve this?
2. I don't know how to set more than one condition using the WHERE statement. Any recommendations?
Thanks
Checking Date
Hello,
I'm displaying an inputbox in a loop that ends only when the user enters a date in the form mm/dd/yyyy
1. How can I ensure that the user enters the correct form of the date?
i.e. mm/dd/yyyy, not mm/dd/yy
2. How can I ensure that the user does not enter some bizzare date?
i.e. 89/01/1999?
Thanks
Date Checking
i have created the program that allow the user to check the date of the credit card expiry date.
my format is mm/dd/yyyy. date and month is ok, if the user key in
improper date , pop up with message. but come to year, the maxlength i have set is 4 places. but each time i key in 1 digit (haven't complete key in 4 digit)it pop up the message "earlier"
but i would like to let it check the whole 4 digit, not one digit by one digit.
my code is :
Private Sub txt_year_change()
If Val(txt_year.Text) < 2002 Then
Call MsgBox("Your Credit card is expired!")
End If
end sub
another problem is i would like to check the year is leap year or not, if it is, allow the user key in 29 in the textbox of date
i know the formula to check it, but where should i put, is that under the sub procedures of date or month or year?
any ideas?
thanks
Help Checking A Date
I have a combo box loaded with a series of 5 Months
APRIL
MAY
JUNE
JULY
AUGUST
Whichever Month is selected, a correspoinding DTPicker defaults to that month.
(If April is selected, the DTPicker automatically reads, 4/01/30)
The user can manipulate the DTPicker to change the Date.
However, the user can also change the month.
The combo box may read April but the user could change the DTPicker to October.
How do I set a check to only allow the DTPicker to have the same Month As the Combo Box?
Getting The Binary Output From A File Without Changing The Access Date
I'm working with some code for calculating the MD5 of a file that I got from another website.
The code actually uses an Open Filename for Binary As #Fnum
Is there a way to retrieve the Binary information from a file without accessing it? The reason I'm asking is the application that I'm working on is suppose to inform the user of how many duplicate files there are on a file server and also tell the user which ones are accessed.
I'm using the MD5 to help identify the duplicate files but I can't seem to do so without changing the Last Accessed attribute.
Any ideas?
Checking To See If User Changes Sys Date - How?
Hey all,
new to the board, and working on my first trial app. I've seen other apps outt there that will prevent a user from running after install if the user has changed the system date in any way. What system files need to be checked, how? Is this a registry thing?
Thanks,
Steve
Checking For Date Type!
i need a code that would check if what the user entered in textbox is a valid date or not
with valid date i mean 12/12/2200 for example
Checking For A Date Format
i have a text box,into which a date must be entered (in the format "##/##/####"). How do i check to ensure that it is entered in this format, that it is a date (and inside certain ranges - ie 31st feb is not allowed). Thanking you in advance!
|