Re: How do you suspend code from continuing
- From: "Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 5 Jul 2005 15:09:37 -0400
"McDal" <McDal@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:30230DD1-5FB1-41A4-844A-F57A1C2F77ED@xxxxxxxxxxxxx
> I have this code:
> Private Sub Command35_Click()
> Dim mfilter As String
> Dim ctl As Control
> Dim varItm As Variant, intI As Integer
> Dim frm As Form
> Dim txtTemp2 As String
> Dim stDocName2 As String
> stDocName2 = "frmDefQuestions"
>
> Set frm = Forms!frmPickDeficiency
> Set ctl = frm!lstDef
> For Each varItm In ctl.ItemsSelected
> txtTemp2 = txtTemp2 & ctl.Column(1, varItm) & ", "
>
> Me.HiddenTextBoxName = txtTemp2
> Me.HiddenTextBoxName = Left(Me.HiddenTextBoxName,
> Len(Me.HiddenTextBoxName) - 2)
> If Me.lstDef.Column(3) = "yes" Then
>
> mfilter = "DefID = " & ctl.Column(0, varItm)
> MsgBox mfilter
> 'Forms!frmPickDeficiency!DeficientItemNum =
> Me.lstDef.Column(0) DoCmd.OpenForm stDocName2, acNormal, ,
> mfilter 'Forms!frmHoistTrolleyInspectData!RecID =
> Forms!frmDefQuestions!subDefAnswer!RecID
>
>
> If CurrentProject.AllForms("frmDefQuestions").IsLoaded =
> False Then
> 'Form is closed
> GoTo 100
> Else
> 'form is open
> End If
>
> End If
> 100 Next varItm
>
>
> I want to be able to suspend this code from going to Next Varitm
> until the form "frmDefQuestions" is closed.
>
> This code is obviously not working for me the way I want. I works but
> it doesn't look like it's executing the if stmt for
> Currentproject.AllForms.
>
> I only want to go get the next item in what was selected in the
> listbox after I've filled out the form I opened called
> frmDefQuestions.
>
> Any ideas...I'm sure someone has done this before...I'm stumped.
You don't need that test, and as written it wouldn't do anything useful
anyway. Just open the form in dialog mode:
DoCmd.OpenForm stDocName2, acNormal, , mfilter, , acDialog
That will pause the code until the form is closed or hidden.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
.
- Follow-Ups:
- Re: How do you suspend code from continuing
- From: McDal
- Re: How do you suspend code from continuing
- References:
- How do you suspend code from continuing
- From: McDal
- How do you suspend code from continuing
- Prev by Date: Re: command buttons not responding
- Next by Date: Date on subform to equal that of the Parent
- Previous by thread: RE: How do you suspend code from continuing
- Next by thread: Re: How do you suspend code from continuing
- Index(es):