473,471 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

help in two forms

I would need a little help or example on formulation of two forms.

On the first one I would like to chose from Combo box »Year of
Occupation« (properties of this combo box - row source type is Value
List, for example 1990 - 2004) and then press on the OK button .

Button OK opens other form in which I enter all data of employees,
in field »Year of Occupation« which it exists in the table Employed
automatically writes out only year, which I have chosen in the first
form (for example 1990 ).

Thank you for your help, Mojca
Nov 12 '05 #1
2 1336
Mojca wrote:
I would need a little help or example on formulation of two forms.

On the first one I would like to chose from Combo box »Year of
Occupation« (properties of this combo box - row source type is Value
List, for example 1990 - 2004) and then press on the OK button .

Button OK opens other form in which I enter all data of employees,
in field »Year of Occupation« which it exists in the table Employed
automatically writes out only year, which I have chosen in the first
form (for example 1990 ).

Thank you for your help, Mojca


Let's say the combo box is called ComboYear, the field to limit is
called OccYear, the form to open called Employee

In the OnClick Event it would look something like this
Private Sub CommandOK_Click
Dim strFilter As STring
If Not IsNull(Me.ComboYear)
'show only for year, if null show all
strFilter = "[OccYear] = " & Me.comboYear
ENdif
DOcmd.openform Employee,,,strFilter
ENd Sub

you could also do something like
Private Sub CommandOK_Click
Dim strFilter As STring
If Not IsNull(Me.ComboYear)
'show only for year, if null show all
strFilter = "[OccYear] = " & Me.comboYear
ENdif
DOcmd.openform Employee
FOrms!Employee.Form.Filter = strFilter
FOrms!Employee.Form.FilterOn = (strFilter > "")
ENd Sub

Nov 12 '05 #2
Salad <oi*@vinegar.com> wrote in message news:<lk***************@newsread1.news.pas.earthli nk.net>...
Mojca wrote:
I would need a little help or example on formulation of two forms.

On the first one I would like to chose from Combo box »Year of
Occupation« (properties of this combo box - row source type is Value
List, for example 1990 - 2004) and then press on the OK button .

Button OK opens other form in which I enter all data of employees,
in field »Year of Occupation« which it exists in the table Employed
automatically writes out only year, which I have chosen in the first
form (for example 1990 ).

Thank you for your help, Mojca


Let's say the combo box is called ComboYear, the field to limit is
called OccYear, the form to open called Employee

In the OnClick Event it would look something like this
Private Sub CommandOK_Click
Dim strFilter As STring
If Not IsNull(Me.ComboYear)
'show only for year, if null show all
strFilter = "[OccYear] = " & Me.comboYear
ENdif
DOcmd.openform Employee,,,strFilter
ENd Sub

you could also do something like
Private Sub CommandOK_Click
Dim strFilter As STring
If Not IsNull(Me.ComboYear)
'show only for year, if null show all
strFilter = "[OccYear] = " & Me.comboYear
ENdif
DOcmd.openform Employee
FOrms!Employee.Form.Filter = strFilter
FOrms!Employee.Form.FilterOn = (strFilter > "")
ENd Sub


I would like to readout all records from this year. All employed of year 1990.

Thanks, Mojca
Nov 12 '05 #3

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

Similar topics

2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
2
by: Anita C | last post by:
Hi, How do I associate or map a specific column in a datatable to a particular element present in an xml document - to read into a datatable as well as write from the datatable to the xml element?...
7
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34...
5
by: MFC | last post by:
Ok, after three C# books, (C# How to Program, Programming in the Key of C#, and C# Weekend Crash Course) and three weeks, I believe I have tried everything to make a certain form function...
2
by: Brian | last post by:
I am very new to VB.NET and I just need some help in a listbox matter. I don't need suggestions on how to make the overall code better. I will get there. I want to move an item from one list box...
8
by: Alison | last post by:
Hi, Al I am trying to design a user interface which provides both menus and toolbars for some users to click on whatever they want to do, at the same time, I would like to have a console window...
1
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following...
6
by: cj | last post by:
Lets just take this example I'm looking at now. I'm looking at the help screen titled .NET Framework Class Library FolderBrowserDialog Class . It gives an example at the bottom that begins with:...
0
by: BigAl.NZ | last post by:
Hi Guys, I am trying to write/copy some code that uses events with a GPS. Everytime the GPS position updates the event fires. The GPS code is from a SDK Library that I got called GPS Tools...
9
by: Ringo | last post by:
the LeafProject http://www.leafproject.org has a DLL for Face recognition. it is written in C++ but they interface to it from Lisp. I want to interface to it from C#. Their Lisp definitions looks...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.