Hello
Iam trying to find a date from table "taqrir" matching to date in unbound text box in form by this code as below: -
-
Private Sub cmdAppend_Click()
-
Dim dbs As Database
-
Dim rs As Recordset
-
If IsNull(Me.M_Date) Then
-
MsgBox "Please Enter desire Monday date first!"
-
Else
-
Set dbs = CurrentDb
-
Set rs = dbs.OpenRecordset("Taqrir", dbOpenDynaset)
-
rs.FindFirst "[Date]=#" & Me.M_Date & "#"
-
-
If rs.NoMatch Then
-
-
-
-
DoCmd.RunSQL "INSERT INTO Taqrir ( Std, darajah, subid, period, dayid, srno )SELECT [darajah] & [div] & [sex] AS Std, [jadwal table].darajah, [jadwal table].subid, [jadwal table].period, [jadwal table].dayid, [jadwal table].srno FROM [jadwal table]WHERE ((([jadwal table].darajah)>0));"
-
DoCmd.RunSQL "PARAMETERS [Forms]![frm_main]![M_Date] DateTime;UPDATE Taqrir SET Taqrir.[Date] = IIf([dayid]=1,[Forms]![frm_main]![M_Date],[Forms]![frm_main]![M_Date]+([dayid]-1))WHERE (((Taqrir.Date) Is Null));"
-
-
MsgBox "Data Appended successfully!"
-
-
Else
-
'Display the found record in the form.
-
MsgBox "Data already appended for this date! Get print outs of them from below. "
-
End If
-
Set rs = Nothing
-
End If
-
End Sub
-
I have matching date in taqrir table, but instead i am getting No Match results. Please help to resolve this issue.
I wil be too grateful of u.
Mustafa Shfaqat husain
1 3929
Hello
Iam trying to find a date from table "taqrir" matching to date in unbound text box in form by this code as below:
Private Sub cmdAppend_Click()
Dim dbs As Database
Dim rs As Recordset
If IsNull(Me.M_Date) Then
MsgBox "Please Enter desire Monday date first!"
Else
Set dbs = CurrentDb
Set rs = dbs.OpenRecordset("Taqrir", dbOpenDynaset)
rs.FindFirst "[Date]=#" & Me.M_Date & "#"
If rs.NoMatch Then
DoCmd.RunSQL "INSERT INTO Taqrir ( Std, darajah, subid, period, dayid, srno )SELECT [darajah] & [div] & [sex] AS Std, [jadwal table].darajah, [jadwal table].subid, [jadwal table].period, [jadwal table].dayid, [jadwal table].srno FROM [jadwal table]WHERE ((([jadwal table].darajah)>0));"
DoCmd.RunSQL "PARAMETERS [Forms]![frm_main]![M_Date] DateTime;UPDATE Taqrir SET Taqrir.[Date] = IIf([dayid]=1,[Forms]![frm_main]![M_Date],[Forms]![frm_main]![M_Date]+([dayid]-1))WHERE (((Taqrir.Date) Is Null));"
MsgBox "Data Appended successfully!"
Else
'Display the found record in the form.
MsgBox "Data already appended for this date! Get print outs of them from below. "
End If
Set rs = Nothing
End If
End Sub
I have matching date in taqrir table, but instead i am getting No Match results. Please help to resolve this issue.
I wil be too grateful of u.
Mustafa Shfaqat husain
Try this and see if it helps. Access date data types have date and time components. Using the DateValue function will extract just the date component. I am not positive, but I don't think you need date delimiter # when DateValue used, but try it both ways:
rs.FindFirst "[Date]= " & DateValue(Me.M_Date)
if the above does not work, then try this with date delimiter.
rs.FindFirst "[Date]=#" & DateValue(Me.M_Date) & "#"
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rainmaker |
last post by:
Greetings,
I have not been able to find the documentation that will allow me to
insert
php code inside the html code in the $message block in the mail() function.
Using the example in the help...
|
by: Got2Go |
last post by:
Hello Group,
I have a table that has 3 columns:
ID (int), datetime, Value(varchar)
ID = ID for the SNMP device
datetime = time record was added
value = value added for that device.
This...
|
by: John Fitzgerald |
last post by:
Hi, I have the following two tables:
1. Client Table
ID - Primary Key
2. Enrollment Table
EnrollID - Primary Key
ClientID - Foreign Key
Enroll Date
|
by: Mahesha |
last post by:
Hello,
I need help in replacing one string pattern with another.
Ex: I have a financial security expression like
log(T 3.25 6/24/2004)/sqrt(T 4.5 6/19/2002)
Here "T 3.25 6/24/2004" is a...
|
by: James Radke |
last post by:
Hello,
I have a multithreaded windows NT service application (vb.net 2003) that I
am working on (my first one), which reads a message queue and creates
multiple threads to perform the processing...
|
by: Timothy.Rybak |
last post by:
Hello all,
This is my first attempt at an application, so kid gloves are
appreciated.
I need to make a very simple form that only has a few elements. One is
TraceCode - a text field that is...
|
by: D |
last post by:
Hello all...I have an issue with one of my java script functions that
I'm hoping someone can easily help with. I have a web based application
that we use to create/sign up for overtime. When we...
|
by: georges the man |
last post by:
The purpose:
• Sorting and Searching
• Numerical Analysis
Design Specification
You are to write a program called “StockAnalyser”. Your program will read a text file that
contains historical...
|
by: gunimpi |
last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431
********************************************************
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help
wanted...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |