Dlookup not populating

jwcclarke

Registered User.
Local time
Today, 09:27
Joined
Mar 21, 2013
Messages
11
Hey guys
Hoping someone will be able to help me with this Dlookup

I have attached a sample database of the form in question,
In a nutshell, the user answers questions and a mark is given based on the answer, and I’m using the Dlookup to pull across that answer mark, to the Call outcome tab, in the Fscore form. However I have not been able to get this to work correctly yet, (we will be changing the scored on the questions as we get a better idea of the marks that we need)

I have tried the two Dlookups that I know of if you would like to see the code I have used already and hasn't worked it in in the last question of the Summary tab "On change"

If anyone can see what I’m doing wrong, or even has an idea how this could work another way, like I said the scores will be changing as time progressed and my not be updated by someone who can read VBA and know what they are doing so will need to be this way, as I can think of at the moment.
Thanks for your help
Jay
 

Attachments

Are you talking about this bit of code?

Code:
'Question 1
    If Me.Text90.Value = "yes" Then
    S1Q = DLookup("[Yes]", "Markings", "MarkingID=" & Forms![Score]!Q1L)
    Else
    If Me.Text90.Value = "No" Then
    S1Q = DLookup("[NO]", "Markings", "MarkingID= '" & Forms!FScore1!Q1L & "'")
 
 
    Else
    S1Q = DLookup("[N/A]", "Markings", "MarkingID=" & Forms![Score]!Q1L)
  End If
    End If
End Sub

If so, one reason it is failing is the criteria

"MarkingID=" & Forms![Score]!Q1L

- you don't have a form called Score or FScore1, but you do have one called Fscore
 
Sorry this is because of me rushing through,

the Sample is a stripped down version of a much larger database but because of DPA i couldnt put up what i had,

[Score] was the origanal name, when that didn't work i renamed it to Fscore & Fscore1. I left the orginal code i had in to let people see what i had attempted to do, and i have been focusing on the No aswer as this would have a different score (in a version i thought i had working, all the other answers were just pulling though the score for question 1) so i have just been trying to get the No mark to come though and the plan was once i had this working i would expanded it to the other options and the rest of the 18 questions sorry abotu any confusion
 
Your MarkingID is text and your Q1L control is a label so try

"MarkingID= '" & Forms![Score]!Q1L.caption & "'"
 
So Simple! thank you worked brilliantly!!

Cheers London
 

Users who are viewing this thread

Back
Top Bottom