By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,480 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,480 IT Pros & Developers. It's quick & easy.

Open form based on listbox contents

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.