473,395 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Query results in a form

I have a slight problem as i am a bit weak on access skills, I am
trying to run a query by selecting the criteria value from a combo box.
I have got that to work and it produces results from the query.
However i would like to display these results in a form so that it is
more user friendly. How do i do this?

Also I am using a procedure in my database that looks for the username
of the current user logged on using some api thing, looks something
like this:

Function fOSUserName() As String
Dim lngLen As Long, lngx As Long
Dim strUserName As String
strUserName = String(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If lngX<>0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = ""
End If
End Function

Does this look right, i took it from a website somewhere. Also how do I
then use this to make it so that i can store a users username without
them having to type it in on a form?
Hope this makes some kinda sense!

Nov 13 '05 #1
1 2411
With regards to your second question, it looks as though you got the code
from http://www.mvps.org/access/api/api0008.htm at "The Access Web". In
order for the function you work, you also need the declaration that precedes
the function on that page:

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Afraid I don't understand what you want in your first question.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<te**********@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have a slight problem as i am a bit weak on access skills, I am
trying to run a query by selecting the criteria value from a combo box.
I have got that to work and it produces results from the query.
However i would like to display these results in a form so that it is
more user friendly. How do i do this?

Also I am using a procedure in my database that looks for the username
of the current user logged on using some api thing, looks something
like this:

Function fOSUserName() As String
Dim lngLen As Long, lngx As Long
Dim strUserName As String
strUserName = String(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If lngX<>0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = ""
End If
End Function

Does this look right, i took it from a website somewhere. Also how do I
then use this to make it so that i can store a users username without
them having to type it in on a form?
Hope this makes some kinda sense!

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Cocker | last post by:
Hello, I'm quite weak at PHP, so I was hoping to get some help understanding the below code. First off, I'm trying to create a "query form" that will allow me to display the results on my...
3
by: thomas goodwin | last post by:
I have a query which asks for a parameter value to execute it. To see the results I have to: a) click on the query -- the "Enter Parameter Value" window pops up. b) enter the parameter value c)...
3
by: cassandra.flowers | last post by:
Hi, I was wondering if it is possible (Using access) to have a query parameter as a drop down box rather than a text box? e.g. typing as criteria for a query produces a box with a text box...
1
by: Raposa Velha | last post by:
Olá Luisa ;-) If I understood correctly, you would like to display the results of a query in a form. No problem, just go to the "Create form by using wizard" and at the first step just choose...
1
by: Kevin.S.Campbell | last post by:
Greetings, I'm trying to run a sql query on a continous form. I have the query working correctly the way I want it. I want this query to be displayed on the form in the text box on the load...
8
by: GeorgeSmiley | last post by:
Does anyone know of a way, via VBA, to set the screen position of query results to a particular top, left position? I've glanced at API techniques but cannot find exactly what will do the trick....
10
by: sesling | last post by:
I have created a query that will pull information from our database for the operators. This query will pull in on average 50,000 records. The operators need to refine the search results. I have...
1
by: tomlebold | last post by:
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on...
1
by: bgreenspan | last post by:
Hi Everyone, I'm back for some more expert help. Here's what I am doing and what I tried. My database has entries with Contract Names and Expiry Dates, among other fields. I have a form...
1
by: igor221189 | last post by:
Hello everyone. I have Access 2000 database which holds student records in the school.It stores subject grades for each student.In the 'Student Grade Form', I would like to search student surname...
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.