UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Detail_mousemove(button...), Access 2003    
 
   
ghoti
post Oct 22 2017, 04:09 PM
Post#1



Posts: 184
Joined: 29-June 05



Good evening.

On my one and only form I have 10 unbound controls which should be populated from the results of 10 other unbound controls (on the same form).

I have written some code and put it in a Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Private Sub. it the Form

I just can't get it to work. I seems to do nothing, at least, the required controls are not populated.

I have tried it in a module but still no luck.

Any thoughts on why it is not working - I've been at it for more than the last 6 hours!
Go to the top of the page
 
ghoti
post Oct 22 2017, 05:00 PM
Post#2



Posts: 184
Joined: 29-June 05



Hi Ridders - A little explanation: This is a quiz with 10 questions per record. Each record has ID (Key), the 10 Questions controls, 10 Answer controls both bound to the Table.

Then the are 10 unbound controls (Adj1-10) and !0 Score controls (Score1 - Score10). The "Adj" controls are for Adjusting the answers to lower case as the computer will be doing the scoring!

Scores are 1 point for correct, 0 for no answer and -1 for incorrect answer. It is anticipated that there may be as many as 20 or 30 records in total.

I am just using numbers to test the quiz at the moment.

From my reckoning, there is a problem with the first line of the code: If ([ID] = 1) Then I could be wrong and usually am!!

CODE
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Thanks for your help
Dim Score1 As Integer, Score2 As Integer, Score3 As Integer, Score4 As Integer
Dim Score5 As Integer, Score6 As Integer, Score7 As Integer, Score8 As Integer
Dim Score9 As Integer, Score10 As Integer

Dim Adj1 As String, Adj2 As String, Adj3 As String, Adj4 As String, Adj5 As String
Dim Adj6 As String, Adj7 As String, Adj8 As String, Adj9 As String, Adj10 As String
Dim ID As Integer

If ([ID] = 1) Then
    Score1 = IIf(IsNull([Adj1]), 0, IIf([Adj1] = "five", 1, -1))
    Score2 = IIf(IsNull([Adj2]), 0, IIf([Adj2] = "eight", 1, -1))
    Score3 = IIf(IsNull([Adj3]), 0, IIf([Adj3] = "two", 1, -1))
    Score4 = IIf(IsNull([Adj4]), 0, IIf([Adj4] = "seven", 1, -1))
    Score5 = IIf(IsNull([Adj5]), 0, IIf([Adj5] = "four", 1, -1))
    Score6 = IIf(IsNull([Adj6]), 0, IIf([Adj6] = "nine", 1, -1))
    Score7 = IIf(IsNull([Adj7]), 0, IIf([Adj7] = "three", 1, -1))
    Score8 = IIf(IsNull([Adj8]), 0, IIf([Adj8] = "one", 1, -1))
    Score9 = IIf(IsNull([Adj9]), 0, IIf([Adj9] = "six", 1, -1))
    Score10 = IIf(IsNull([Adj10]), 0, IIf([Adj10] = "ten", 1, -1))
End If
End Sub


Thanks for your help.
Go to the top of the page
 
ghoti
post Oct 22 2017, 05:34 PM
Post#3



Posts: 184
Joined: 29-June 05



Thanks for coming back so quickly, Ridders.
I tried you advice but I get an error -Expected ) just after "Then" (Just re-checked - Compile error - Expected: ). ) I had this earlier on today and no matter what I tried, the only way I could get Access to not find fault was the bracket where you found it in my code.

If you are unsure what IIS happening, here is a screen shot of the first record - it may help - the white controls are unbound.
Attached File(s)
Attached File  Quix_sample.jpg ( 60.4K )Number of downloads: 4
 
Go to the top of the page
 
ghoti
post Oct 23 2017, 02:03 PM
Post#4



Posts: 184
Joined: 29-June 05



I'm back again - I just couldn't get the code to fill the Score control on the form (the last set of 10 white controls). I was up until 3a.m. trying to resolve it, as you will see from the code!! Message boxes galore to see where the debugger was or had just passed over for some reason. I've just spent another 3 hours and I have very little hair left on my head!!

Attached is my effort at creating the quiz template.
The reason I was trying to sub with "Move Mouse" is that I thought that it was a good way of ensuring that the controls would be filled befoe moving on to record 2 (or page 2) of the quiz.

I am sure there are easier ways to do most things that I have done.

Thanks again for your involvement.

All comments welcome.

"fish"
Attached File(s)
Attached File  QuizTest.zip ( 73.58K )Number of downloads: 3
 
Go to the top of the page
 
moke123
post Oct 23 2017, 02:47 PM
Post#5



Posts: 1,148
Joined: 26-December 12
From: Western Ma.,L.I.,N.Y.,Jupiter,Fl.



I think part of your problem is your table structure and normalization.

take a look at this survey db which may give you some ideas...At your survey
Go to the top of the page
 
ghoti
post Oct 24 2017, 04:14 PM
Post#6



Posts: 184
Joined: 29-June 05



Hi Ridders

Redesign the Table structure in what way? As far as I can see, it couldn't be more straight forward.

On GroverParkGeorge's advice, many of the original items in the table which were 'calculations' , were changed to unbound controls on the form (those in white) and deleted d from the table. Thus it is much smaller now! Not to say it was large originally IMO.

Should I have the current table split to make several tables?
Go to the top of the page
 
ghoti
post Oct 24 2017, 04:18 PM
Post#7



Posts: 184
Joined: 29-June 05



Hi Moke, As I said to Ridders, how could I alter the table structure - there's not much in it as far as I understand. And what do you mean by normalization of the table?

I had a look at the example that you posted, and to be quite frank, I was lost in it - it seems to me, a layman in VBA and database design. I thought I was doing something relatively simple.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    14th December 2017 - 11:46 AM