Urgent Help is Needed Please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good day, I really really need help on this. Please see below code:

' Picked one from the list, so open DentalEdits filtered ...
' (Also activated if they double-click anywhere on the row)
gstrWhereCallProfileQuerybyDental = "[RecordNumber] = """ &
Me!RecordNumber & """"
DoCmd.OpenForm FormName:="frmDentalEdits",
WhereCondition:=gstrCallProfileQuerybyDental
Forms!frmDentalEdits.SetFocus

I created a continous form that shows chosen records for date range that I
input. When I click on the View details button where the above code is
written it just opens a report, but the report don't match the record I
selected what am I missing. example I select John Doe from continous form,
click view details and Jane Doe comes up. Please Please Please help.
 
I created a continous form that shows chosen records for date range that I
input. When I click on the View details button where the above code is
written it just opens a report, but the report don't match the record I
selected what am I missing. example I select John Doe from continous form,
click view details and Jane Doe comes up. Please Please Please help.

Your code is opening a Form; your narrative talks about a Report. Which is it?
What's the name of the report that's being opened? What do you mean by the
"view details button" - where is this button?

John W. Vinson [MVP]
 
The first thing I see is the where clause is no correct. I'm unsure if
[RecordNumber] is a number or text though.
If it's a number it should look like this:
gstrWhereCallProfileQuerybyDental = "[RecordNumber] = " & Me!RecordNumber

If it's text:
gstrWhereCallProfileQuerybyDental = "[RecordNumber] = '" &
Me!RecordNumber & "'"

This is a common mistake with the quotes
-Lionel
 
Back
Top