Hello all
How do I write this SQL in VBA code:
SELECT DISTINCTROW Employees.UsernameHold, [Expense
Reports].ExpenseReportID, [Expense Reports].EmployeeID, [Expense
Reports].ExpenseType, [Expense Reports].ExpenseRptName, [Expense
Reports].ExpenseRptDescr, [Expense Reports].DateSubmitted, [Expense
Reports].DepartmentCharged, [Expense Reports].BusinessPurpose, [Expense
Reports].[Period Ending], [Expense Reports].[End Milage], [Expense
Reports].[Start Milage], [Expense Reports].[Bus Miles] FROM Employees
INNER JOIN [Expense Reports] ON Employees.EmployeeID=[Expense
Reports].EmployeeID WHERE (((Employees.UsernameHold)=CurrentUser()) AND
(([Expense Reports].EmployeeID)=[forms]![Expense Reports by
Employee]![EmployeeID]));
Like I know how to write:
SELECT Employees.EmployeeID, Employees.DepartmentName,
Employees.EmployeeNumber, Employees.FirstName, Employees.LastName,
Employees.Notes, Employees.[Auto Year], Employees.[Auto Condition],
Employees.[Auto Make], Employees.UsernameHold FROM Employees
-----Me.RecordSource = "SELECT * FROM Employees"
But I dont know how to write the other SQL, Can somebody tell me please
Thank you in advance 4 1706
SELECT [Expense Reports].ExpenseReportID, [Expense Reports].EmployeeID,
[Expense Reports].ExpenseType, [Expense Reports].ExpenseRptName,
[Expense Reports].ExpenseRptDescr, [Expense Reports].DateSubmitted,
[Expense Reports].DepartmentCharged, [Expense Reports].BusinessPurpose,
[Expense Reports].[Period Ending], [Expense Reports].[End Milage],
[Expense Reports].[Start Milage], [Expense Reports].[Bus Miles],
[Expense Reports].UsernameHold
FROM [Expense Reports]
WHERE ((([Expense Reports].EmployeeID)=[forms]![Expense Reports by
Employee]![EmployeeID]));
This is the SQL that I need to write in VBA not the last I posted
Ups, no!....still need help, sorry about that
Any ideas ?
Me.RecordSource = "SELECT [Expense Reports].ExpenseReportID, [Expense
Reports].EmployeeID, " & _
"[Expense Reports].ExpenseType, [Expense Reports].ExpenseRptName, " & _
"[Expense Reports].ExpenseRptDescr, [Expense Reports].DateSubmitted, " & _
"[Expense Reports].DepartmentCharged, [Expense Reports].BusinessPurpose, " &
_
"[Expense Reports].[Period Ending], [Expense Reports].[End Milage], " & _
"[Expense Reports].[Start Milage], [Expense Reports].[Bus Miles], " & _
"[Expense Reports].UsernameHold " & _
"FROM [Expense Reports] " & _
"WHERE ((([Expense Reports].EmployeeID)=[forms]![Expense Reports by
Employee]![EmployeeID]));" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: PHPkemon |
last post by:
Hi there,
A few weeks ago I made a post and got an answer which seemed very logical.
Here's part of the post:
PHPkemon wrote:
> I think I've figured out how to do the main things like...
|
by: Tank |
last post by:
I have had this post up here when i was trying to figure out how to
make leading zeros and have been able to fudge that to work. I am now
have trouble getting the loop that makes the folders to...
|
by: rainbowii7 |
last post by:
Calling all programmers for helllllllllllllllppppp!!! i am currently
doing a uni degree and our lecturers have set us the task of making a
game in JavaScript.
i chose to do a hangman game and...
|
by: Shaggyh |
last post by:
hi im needing help with a program im writing to do subnetting
i was on before about it and i got some help.
the code below wont work for me and i cant think of why not.
i was wondering if anyone...
|
by: aarthy |
last post by:
Hi,
I have a problem in the display of the ASP screen actually i am
retrieving and displaying the data from a database when the view button
is hit.The contents for display is so long so i want...
|
by: althafexcel |
last post by:
hi everyone
Im trying to include an external js in my aspx page under the head
tag, it doesn't load or it displays an object expected error whenver
the function from the .js is called. Actually...
|
by: TF |
last post by:
Hello all,
I made a ASP.NET 2.0 site that shows possible "recipes" for paint
colors stored in an access dbase. Basically, 1000 colors are stored
with specific RGB values in separate columns. A...
|
by: dsoutherland |
last post by:
I am so new to ASP I'm not sure I am breathing. A company one of my clients deals with provides information over the web. They provided the ASP code for a default web site that is used to...
|
by: jenipriya |
last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors...
The table structures i hav
Employee (EmpID,...
|
by: maxxxxel |
last post by:
Hi
Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine.
Our problem is that when we send...
|
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: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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: 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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |