Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where condition of openform not clear ? 1

Status
Not open for further replies.

Schaap

Technical User
Jul 6, 2004
54
NL
I got a problem with the where condition of the cmd.openform !
See code below :

Option Compare Database
Option Explicit
Dim Plaats As String

Private Sub IndexNumber_Click()

Plaats = Me.IndexNumber
DoCmd.Close
DoCmd.OpenForm "ApplicationForm", acPreview, , "IndexNumber = Plaats"

End Sub
Explanation :
I have a form where a part (selection) of the database is shown. When I click on an indexnumber the "Application Form" of that particular indexnumber has to be opened.
Instead of opening this "Application Form" I got an inputbox where I have to fill in a value for the variable "Plaats" !!! After this I get the right "Application Form" on the screen !!!
But I don't wanna see the inputbox. The meaning is that Plaats gets the value of Me.IndexNumber. When I walk through the code it will !
Something is wrong with the last DoCmd-line. How do I define the where condition, so that the value of Plaats will be checked ?
 
Hi!

Try:
[tt]DoCmd.OpenForm "ApplicationForm", acPreview, , "IndexNumber = " & Plaats[/tt]

- i e concatenate the value into the criteria string

Roy-Vidar
 
Thanx Roy-Vidar,

I know that it was something like this, but I didn't know how exactly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top