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

Open form based on listbox contents

The menu form has two options, one to create a new estimate, the second to
open an existing estimate.

Under option two is a list box containing all of the estimates. There are
several different estimate categories however. The siginificance is, all of
the estimates are in the same table, but there are different forms for
viewing and editing each type. Each estimate record has a field for
EstimateType. The user selects an estimate from the list and clicks the OK
button. I am trying to write code that will open the appropriate form based
on the contents of EstimateType.

My code so far is...

If optNew = True Then
Select Case Me.grpEstimateType
Case 1
DoCmd.OpenForm "frmEstimatePatio", , , , acFormAdd
End Select
ElseIf optExisting = True Then
DoCmd.OpenForm "frmEstimatePatio", , , "EstimateID = " &
Me.lstEstimateSelection
Else
MsgBox "You have not made a selection."
End If

This allows me to open up frmEstimatePatio to the appropriate record, but
not change which form is used.

Any guidance?
May 19 '07 #1
1 2307
Bump

"Kevin" <no**@email.comwrote in message
news:Kk********************@fe10.news.easynews.com ...
The menu form has two options, one to create a new estimate, the second to
open an existing estimate.

Under option two is a list box containing all of the estimates. There are
several different estimate categories however. The siginificance is, all
of the estimates are in the same table, but there are different forms for
viewing and editing each type. Each estimate record has a field for
EstimateType. The user selects an estimate from the list and clicks the OK
button. I am trying to write code that will open the appropriate form
based on the contents of EstimateType.

My code so far is...

If optNew = True Then
Select Case Me.grpEstimateType
Case 1
DoCmd.OpenForm "frmEstimatePatio", , , , acFormAdd
End Select
ElseIf optExisting = True Then
DoCmd.OpenForm "frmEstimatePatio", , , "EstimateID = " &
Me.lstEstimateSelection
Else
MsgBox "You have not made a selection."
End If

This allows me to open up frmEstimatePatio to the appropriate record, but
not change which form is used.

Any guidance?

May 21 '07 #2

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

Similar topics

4
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
2
by: JJ | last post by:
Hi All, When someone selects a value in a select on a form I want to show the same form with another select with certain values depending on first select. How can I do this? Should I keep...
6
by: John | last post by:
Just a general question... I'm currently using a combobox that when updated, opens a form with its recordset based on a query using the combo box value as the criteria. I'm I correct in...
1
by: bruce | last post by:
Hello, I have a small form that pops up when a user moves off the current record of a rather sizeable data entry form. The purpose of this form is to list warnings about various fields on the...
8
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me...
14
by: Professor Yonce | last post by:
I have made form for E-Mail. I have entered code but the Import system does not work. It has squiggly line underneath it showing it is not communicating. It Will not build. Public Class...
7
imrosie
by: imrosie | last post by:
Hellol, I'm again in need of your help with my Order processing system.. My Order form is based on (query) of Customer and Order tables (includes a subform for the product data)...has a listbox...
2
by: C_Kubie | last post by:
I have a populater listbox and I update the contents by running a different SQL statement via listbx.Rowsource ="<SQL statement>" The contents of the listbox changes but the form doesn't. ...
5
by: lukasmazur | last post by:
Hi I have a problem with using listBox1. I have a two forms form1 and form2. In form1 are controls listBox1, textBox1 and button witch creating object of class Form2. In class Form2 I create a...
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: 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
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
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...

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.