I think im having a problem understanding the logic behind this, sorry. But
the post you said i did wrong, why is it not necessary to assign the
rowsource under the "If IsNull" part like this:
Private Sub Rig_Name_AfterUpdate()
If IsNull(Me.ActiveControl) Then
[OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
[RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
[MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
The way i understand this is, it is saying that if the Rig Name box is
empty, then the [owner], [rig heading], and [mooring type] combo boxes get
their values from the table. And since i would like to go in a random order
through my boxes, i would have thought that its necessary to have all
rowsource values assigned there.
Does my logic make sense at all? Or how should the code be read to make
sense to me?
Also, i have not gotten my form to work yet sadly.
"Mark A. Sam" wrote:
> No that's wrong. You are trying to assign the rowsource for all of the
> combo boxes. It is like this, where you are only setting the Rowsource from
> [Owner] if [Rig] gets a value.
>
> Private Sub Rig_Name_AfterUpdate()
> If IsNull(Me.ActiveControl) Then
> [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME " & _
> "From MODU " & _
> "WHERE MODU.RIG_NAME= '" & [Forms]![MODULIST]![RIG NAME] & "';"
> Else
> [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> End If
> End Sub
>
>
> If [Owner] gets a value, then set the Rowsource for [Rig Heading], etc.
>
>
> "Adam" <(E-Mail Removed)> wrote in message
> news:8637D34D-5173-4B39-8682-(E-Mail Removed)...
> > Not too sure if i am doing this correctly, but thats why i'm here.
> >
> > Ive knocked down my 13 combo boxes i need to have down to 4, just to
> > simplify this until i figure it out, but my combo boxes are:
> > [Rig Name]
> > [Owner]
> > [Rig Heading]
> > [Mooring Type]
> >
> > My table is named MODU
> >
> > and here is what i put into the after update box from what you had posted
> > (with added nonsense, im sure, since im not into coding)
> >
> > Private Sub Rig_Name_AfterUpdate()
> > If IsNull(Me.ActiveControl) Then
> > [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME " & _
> > [RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME " & _
> > [MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME " & _
> > "From MODU " & _
> > "WHERE MODU.RIG_NAME= '" & [Forms]![MODULIST]![RIG NAME] & "';"
> > Else
> > [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> > [RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> > [MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> >
> > End If
> > End Sub
> >
> >
> >
> >
> > "Mark A. Sam" wrote:
> >
> >> Disregard my last question. I reread your post and see that you are
> >> narrowing each combo list down.
> >>
> >> I have never been able to figure out an expression that will allow all
> >> values to be shown if there is nothing in the criteria field. I'm not
> >> sure
> >> why it isn't allowed. The best way I could see to approach this is the
> >> allow all the whole list to be displayed and reset the the rowsource of
> >> the
> >> following combo whenever you select from any combo. It isn't difficult
> >> to
> >> do, but difficult to explain to someone who doesn't program.
> >>
> >>
> >>
> >>
> >> "Mark A. Sam" <(E-Mail Removed)> wrote in message
> >> news:%(E-Mail Removed)...
> >> > Do you have anything in the criteria of the queries?
> >>
> >>
> >>
>
>
>