Trouble Populating Form

Annabelle

Registered User.
Local time
Today, 04:11
Joined
Feb 20, 2003
Messages
32
I've been working on a database for many months. It is almost in a workable state. I am having trouble on one of my forms getting a button to show data when clicked.

I am desperate for an answer as this program is needed in our company ASAP.

My program is big in size so I cannot attach it to this message.

If you can help me, I will be very thankful for your assistance.
 
You might get an an answer faster if you:

  • describe the problem; or
  • make a copy of the database and strip out all the irrelevant stuff and post it here
 
Here is VB code I believe completely involves the problem.

Public Sub sSelect(intSelect As Integer)

On Error GoTo ErrorHandler

Const strColors As String = "SELECT tbl_Reference_Color.ID, tbl_Reference_Color.Color " _
& "FROM tbl_Reference_Color " _
& "ORDER BY tbl_Reference_Color.Color;"
Const strOptions As String = "SELECT tbl_Reference_Option.ID, tbl_Reference_Option.Option, " _
& "tbl_Reference_Option.Net FROM tbl_Reference_Option " _
& "ORDER BY tbl_Reference_Option.Option;"
Const strStandardFeatures As String = "SELECT tbl_Reference_StandardFeatures.ID, tbl_Reference_StandardFeatures.Feature, " _
& "FROM tbl_Reference_StandardFeatures " _
& "ORDER BY tbl_Reference_StandardFeatures.Feature;"
Const strForm As String = "frm_Select_ForNewModels"

DoCmd.OpenForm strForm

Select Case intSelect

Case 1 'Color

Forms(strForm)!Selection.RowSource = strColors
Forms(strForm)!Table = "tbl_Join_Model&Color"
Forms(strForm).Caption = "Select Colors"
Forms(strForm)!Field = "ColorID"

Case 2 'Option

Forms(strForm)!Selection.RowSource = strOptions
Forms(strForm)!Table = "tbl_Join_Model&Option"
Forms(strForm)!Selection.ColumnCount = 3
Forms(strForm).Caption = "Select Options"
Forms(strForm)!Field = "OptionID"

Case 3 'Standard Feature

Forms(strForm)!Selection.RowSource = strStandardFeatures
Forms(strForm)!Table = "tbl_Join_Model&StandardFeature"
Forms(strForm)!Selection.ColumnCount = 1
Forms(strForm).Caption = "Select Standard Features"
Forms(strForm)!Field = "FeatureID"

End Select

ExitProcedure:

Exit Sub

ErrorHandler:

Select Case Err.Number

Case Else

MsgBox "Error # " & Err.Number & ": " & Err.Description, vbOKOnly + vbExclamation, "Unexpected Error"

End Select

Resume ExitProcedure

End Sub

Private Sub cmdColors_Click()

Call sSelect(1)

End Sub

Private Sub cmdOptions_Click()

Call sSelect(2)

End Sub

Private Sub cmdStandardFeatures_Click()

Call sSelect(3)

End Sub
 
I have a form for entering model specific data about boat inventory. On the form is a button for defining what colors the boat is available in. Another for defining what options are available on the boat. Another for defining what standard features are on the boat. The colors and options buttons are working. The standard features button is not.

You should click the button for adding features and see all features available. You would then highlight each feature available on the model and click "Add to Selected Model" to add as a feature.

I don't get an error... I simply get a blank box.

Hopefully these last two replies give you a better idea of my problem.
 
There are tables and querires set up which are also involved in the process.

I'm sorry for not being better at explaining this. But it is a little difficult.
 

Users who are viewing this thread

Back
Top Bottom