Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-28-2013, 03:38 AM   #1
jwcclarke
Newly Registered User
 
Join Date: Mar 2013
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
jwcclarke is on a distinguished road
Dlookup not populating

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
Attached Files
File Type: zip Sample.zip (342.3 KB, 41 views)

jwcclarke is offline   Reply With Quote
Old 03-28-2013, 05:32 AM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,328
Thanks: 40
Thanked 3,667 Times in 3,536 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Dlookup not populating

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
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is online now   Reply With Quote
Old 03-28-2013, 06:05 AM   #3
jwcclarke
Newly Registered User
 
Join Date: Mar 2013
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
jwcclarke is on a distinguished road
Re: Dlookup not populating

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

jwcclarke is offline   Reply With Quote
Old 03-28-2013, 06:38 AM   #4
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,328
Thanks: 40
Thanked 3,667 Times in 3,536 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Dlookup not populating

Your MarkingID is text and your Q1L control is a label so try

"MarkingID= '" & Forms![Score]!Q1L.caption & "'"
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is online now   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
jwcclarke (03-28-2013)
Old 03-28-2013, 07:44 AM   #5
jwcclarke
Newly Registered User
 
Join Date: Mar 2013
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
jwcclarke is on a distinguished road
Re: Dlookup not populating

So Simple! thank you worked brilliantly!!

Cheers London

jwcclarke is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dlookup Works but isnlt populating table samjh Forms 4 02-15-2013 05:11 AM
Populating table values in Subform from a table by using Combo Box and/or DLookup BuildingDatabase Modules & VBA 3 08-12-2011 11:47 AM
Nest dlookup inside a dlookup Djblois Modules & VBA 2 06-29-2011 12:06 PM
DLookup not Populating Table Ajay Caleb Forms 3 01-21-2010 01:06 PM
Populating fields in a form - DLOOKUP maneor Forms 3 09-30-2004 11:30 AM




All times are GMT -8. The time now is 04:05 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World