Combo Box "loses value" during form navigation

T

Tom

Hello,

I'm wondering if someone could help me determine as to why I have a "glitch"
in my subform.

Here's what I have (a "Questionnaire" / "Survey"):
- a main form with navigation buttons (cmd buttons vs. the actual default
form navigation buttons). The main form is bound to a table.
- main form contains subform. The subform's has SQL in its record source
property to filter for specific records. I don't think the specific SQL
is important... point is that the navigation buttons on mainform will drive
"what I see on the subform".

Okay, first some background info:
- the subform is in "continous form" mode and contains a drop-down box
(required field) and and optional text box (for comment).
- approximately, I can "view" 3 records. If I'd see more than 3, the
vertical scollbar becomes visible... then I may see an additional 2 or 3
records. 6 max at the most.
- once I have gone through all "44 views" (chapters) of my survey (via using
navigations buttons), I click 'SUBMIT' and a function kicks in that
evaluates whether or not I have forgotten to complete a value in the
required combo box. If yes, it sets focus onto the particular "Chapter's
combo box"... I click SUBMIT another time. Again, the function determines
if there are still unpopulated combos, etc. etc. If there aren't, all
values are then saved in the table and survey forms shuts down.

Now, the "glitch":
- it appears that there's something little bit wrong in the SUBMIT function.
- for instance, I have taken out time to really really complete EVERY SINGLE
combo box.
- when clicking SUBMIT I should simply gone through the loop and submitted
the record.
- however, each and every time, there are approximately 6 to 10 instances
where I supposedly "forgot" to complete selecting an answer from the combo
now. But I'm sure I didn't...
- ... and that's the problem... could it be that somehow via a) navigating
through alll 44 chapters (views) and b) scrolling to the e.g. 5th question
(using vertical scroller on e.g. view #15) a selected value gets
"unselected" in the combo?... so that later on the SUBMIT identifies that
particular combo as one that still requires an answer...

Below is the code of the SUBMIT function... any pointers if there's
something wrong w/ the function or if it could be some totally different
problem with "forms"?

Thanks,
Tom


==========================


'Check survey answers for completion
Dim intChapter As Integer

cmdGotoFirst_Click
DoEvents
For intChapter = 1 To cboIndex.ListCount

DoEvents
subAnswers.SetFocus
With subAnswers.Form
.Recordset.MoveFirst
Do Until .Recordset.EOF
If IsNull(!Answer) Then
MsgBox "Please answer this question!", vbInformation,
"Missing Data"
!cboAnswer.SetFocus
!cboAnswer.Dropdown
Exit Sub
End If
.Recordset.MoveNext
Loop
End With
cmdGotoNext_Click

Next intChapter

MsgBox "Thank you for completing the BSC survey!", vbInformation,
"Survey Status"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top