Help with openform

Blackwidow

Registered User.
Local time
Today, 18:53
Joined
Apr 30, 2003
Messages
149
I am trying to open a second form that is linked to the first form but i cant get it to work it keeps coming up with a syntex error

DoCmd.OpenForm "frmstudentperformancepoorprevious", , , popUPID = '" & Me.StudentPerformanceID & "'"

Any ideas?? trying everything to get this form to link and everything is failing even the wizard which works if you just enter the record... but if you go back to it later and use the button it brings up a blank record
 
The WhereCondition is a string!
DoCmd.OpenForm "frmstudentperformancepoorprevious", , , "[popUPID] = '" & Me.StudentPerformanceID & "'"
 
i've tried that but it just says the operation was cancelled

DoCmd.OpenForm "frmstudentperformancepoorprevious", , , "[popUPID] = '" & Me.StudentPerformanceID & "'"
 
I believe that usually indicates something is *not* spelled correctly. Can you open the form without a WhereCondition parameter?
DoCmd.OpenForm "frmstudentperformancepoorprevious"
 
Try this

Code:
    Dim stDocName As String                        ‘ declaration variable 
    Dim stLinkCriteria As String

    stDocName = "frmstudentperformancepoorprevious"     ‘ stock  a form name
    
    stLinkCriteria = "[popUPID]=" & Me![StudentPerformanceID]  ‘ criterion for command

    DoCmd.OpenForm stDocName, , , stLinkCriteria       ‘ command open form

Le
 
form opens fine with
DoCmd.OpenForm "frmstudentperformancepoorprevious"
 
tried the other code suggested..

back going in circles tried that it works the first time... but if you go off the screen and come back again.. and try to open the other form it comes up blank
 
Is there a Text field in underlying RecordSet of frmstudentperformancepoorprevious named popUPID? If it is a numeric field then your WhereCondition should be:
DoCmd.OpenForm "frmstudentperformancepoorprevious", , , "[popUPID] = " & Me.StudentPerformanceID
 
its a number field but i tried

DoCmd.OpenForm "frmstudentperformancepoorprevious", , , "[popUPID] = " & Me.StudentPerformanceID

and that did exactly the same with giving me a blank record

I've attached the database sorry took so long was so Big!

go to student Allen Raymond and you'll see what I mean when you press the button or create your own using the poor option. (having problems with the good one!)
 

Attachments

The StudentPerformanceID of Allen Raymond is 19. It is a numeric field and there is *no* [popUPID] = to 19 in the underlying table of the frmstudentperformancepoorprevious form. As a matter of fact only one record in the bound table has a popUPID.
 
that was probably my fault rather than it being a problem with the origional forms...

i found out what the problem was

some code was left from frmstudentperformancepoor which i had copied to make the second form frmstudentperformancepoorprevious in the onload()
which was messing it all up...

I cant believe I spent the entire day going round and round in circles and none of the code was wrong it was just my own stupidity!

Thank you for all your help you've been great
 

Users who are viewing this thread

Back
Top Bottom