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

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 1334
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.