textbox - combobox

J

John

I have a form that has a button on it that will copy the information
from one revision to another. Things are working fine with the
exception of if the going to revision is not listed in the combobox
then a message is to alert the user the copying to revision does not
exist. The ElseIf line I was hoping would do a check is the
following;

Dim sql As String

If "" & IsNull(Me.txtCopySpecToRevision) Then
MsgBox "You need to provide the revision that you are copying
to.", vbCritical, "Need Revision"
Me.txtCopySpecToRevision.SetFocus

ElseIf Me.txtCopySpecToRevision.Value <> Forms![Parts]!
cboViewRevision Then
MsgBox "That revision is not on the list.", vbOKOnly, "Wrong
Revision"

Else
sql = "RISpecAndToleranceUpdateFromPreviousRevision '" &
txtCopySpecPartNumber & "', '" & txtCopySpecToRevision & "', " &
gUserID & " "
Call RunSQLServerStoredProcedure(sql)
DoCmd.Close acForm, "xCopySpecsToDifferentRev"

End If


This still throws the message the revision does not exist even if it
does. Am I missing something?

Thanks...John
 
M

Mike Painter

John said:
ElseIf Me.txtCopySpecToRevision.Value <> Forms![Parts]!
cboViewRevision Then
MsgBox "That revision is not on the list.", vbOKOnly, "Wrong
Revision"

Is Parts an open form?
 
J

John

John said:
   ElseIf Me.txtCopySpecToRevision.Value <> Forms![Parts]!
cboViewRevision Then
       MsgBox "That revision is not on the list.", vbOKOnly, "Wrong
Revision"

Is Parts an open form?

Yes. Parts is the main form that has the info on it. The form with
copy button is a popup form that shows the partnumber and the userid.
And the going to revision is placed by the user in the revision
textbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top