473,326 Members | 2,133 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,326 software developers and data experts.

parameters and Forms

hello,

I need someones expertise...
i am the only part-time developer at a start up college now.

question is

i am using Access 2003

and creatng a form with a combination of queries, tables and subforms.
How do I create a parameter.
I know how to create one in a query but one is needed in the form. If i
can avoid the query that would be fine but i do not think that is
possible.

the information is to get employee information
the parameter is for the employee last name

i am using
Employee ID
first
last name
position
address
phone
mobile
other stuff
I would appreciate to help me as soon as u can.

Nov 13 '05 #1
4 1365
selhamawy wrote:
hello,

I need someones expertise...
i am the only part-time developer at a start up college now.

question is

i am using Access 2003

and creatng a form with a combination of queries, tables and subforms.
How do I create a parameter.
I know how to create one in a query but one is needed in the form. If i
can avoid the query that would be fine but i do not think that is
possible.

the information is to get employee information
the parameter is for the employee last name

i am using
Employee ID
first
last name
position
address
phone
mobile
other stuff
I would appreciate to help me as soon as u can.

The thread "excluding records from a query" in my newsreader is the
message just before yours. This may answer your question.

Basically, I like having a full blown query as the recordsource of the
form. I can then open the form with a filter.
Docmd.Openform "FormName",,,"Id = " & Me.ID
or when the form opens I can filter the records. In your case I may
have a combo box (if the list will contain less than 1000 records)
listing the EmpID, EmpLast, and EmpFirst. In the AfterUpdate event I
can enter
If Me.EmpID <> 0 Then
Me.Filter = "EmpID = " & Me.ComboEmp
Endif
Me.FilterOn = (Me.EmpID <> 0) 'sets to true or false

One last thing, I see you have a field called "last name". If I wanted
a pain in the ass, I would use spaces in field names, table names, query
names, etc. If I wanted simplicity, I would not use spaces. I usually
name fields with a capital as the first character of each word. Ex:
lastname becomes LastName. I then can reference easily with the name,
not having to type [] brackets around everything.

Nov 13 '05 #2
Thanks a lot for the Info Salad

1. the notation i used in the group was just for readability
so dont kill me
2. i am currently also getting errors in the following case
searching by last name with multiple records
at that case it gives the first record and then after that
when i go to the next record another parameter box
HOW DO I SUPRESS ALL REPEATING PARAMETER BOXES SO I CAN
SCROLL THROUGH REPEATING LAST NAME RECORDS?????

Thanks ahead of time

Nov 13 '05 #3
Selhamawy,

If I remember correctly you can set the recordsource of a form in the Load
event in versions after 2000. If so, then I'd probably create my own
dialogue box to capture the last name the user wants and use that to write a
SELECT statement that can be the recordsource for the form.

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

"selhamawy" <se*******@gawab.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Thanks a lot for the Info Salad

1. the notation i used in the group was just for readability
so dont kill me
2. i am currently also getting errors in the following case
searching by last name with multiple records
at that case it gives the first record and then after that
when i go to the next record another parameter box
HOW DO I SUPRESS ALL REPEATING PARAMETER BOXES SO I CAN
SCROLL THROUGH REPEATING LAST NAME RECORDS?????

Thanks ahead of time

Nov 13 '05 #4
selhamawy wrote:
Thanks a lot for the Info Salad

1. the notation i used in the group was just for readability
so dont kill me
It was just a warning to save you from working harder than necessary.
2. i am currently also getting errors in the following case
searching by last name with multiple records
at that case it gives the first record and then after that
when i go to the next record another parameter box
HOW DO I SUPRESS ALL REPEATING PARAMETER BOXES SO I CAN
SCROLL THROUGH REPEATING LAST NAME RECORDS?????
I'm not sure of your situation. I may have a continuous form...or a
datasheet contained as a subform in a form. I'll use the continuous
form as a model. The recordsource could be "Select empid, emplast,
empfirst,... from employee order by emplast, empfirst"

I could have a combo box in the PageHeader with the rowsource as "Select
empid, emplast, empfirs from employee order by emplast, empfirst" with a
label defining it as "Find"

The user can enter the last name. When found, press enter key.

In the AfterUpdate event of the combo I could have code like this:
Dim rst As Recordset
set rst = Me.Recordsetclone
rst.findfirst "EmpID = " & Me.ComboEmp
Me.bookmark = rst.bookmark
set rst = Nothing

In the Oncurrent event of the form enter
Me.ComboEmp = Me.EmpID

Your combo and records will then be synchronized.

Of course, if you have multiple "smiths", you can filter on it. Let's
say instead of a combo you use a text box. The person enters "SMI".
You could enter in the afterupdate event some code like
Me.Filter = "EmpLast Like '" & Me.TextEmp & "*'"
Me.FilterOn = True
and this will pull up all records that begin with SMI.


Thanks ahead of time

Nov 13 '05 #5

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

Similar topics

1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
0
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
11
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
10
by: Adis | last post by:
Asp.Net Visual Studio 2003 SQL Server. Hi, Obtaining Data Based Upon Multiple Selections From a ListBox... I have database in Sqlserver and ListBox (Multiple Selection Mode) in my Visual...
0
by: Adis | last post by:
Hi, My purpose consists on filtering the fields "years" and "clients" of a project WinForm, in a similar way to as I make it without any problems in a previous project ASP.NET. The...
1
by: Mikey G | last post by:
Hi, I created a simple VB.NET 2003 application through Visual Studio that connects to a MySQL database and loads a table into a Dataset, and then displays that table information in a DataGrid on a...
5
by: dana1 | last post by:
Hello Experts! Does anyone know if there is a way to set the values of query parameters from VBA for a report's recordsource? (i.e., I want to set the values of the parameters and NOT have the...
4
by: HeislerKurt | last post by:
I'm getting the infamous error, "Too few parameters. Expected 2", when executing an update SQL statement in VBA. I assume it's a SQL syntax issue, but I can't find the problem, and I used a VBA...
7
by: Ceebaby via AccessMonster.com | last post by:
Hi All Here's hoping someone can help me with this. I have a report based on a query where the criteria for 4 of the fields is set from an unbound form. I want the user to be able to select any...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.