Open Form problem

emad981

Registered User.
Local time
Today, 19:17
Joined
Aug 20, 2013
Messages
17
I have two forms
- frmVList with ID (from tblV - Table)
-frmVDetails (with ID as "tblV.ID) as tblV is the table name that contains the ID.
(That is because i made a query between some tables in the control source of [frmVDetails]

I want to click ID in [frmVList] to open [frmVDetails] where ID = tblV.ID

I wrote the code like the following but did not work:

Code:
Private Sub ID_Click()
DoCmd.OpenForm "frmVDetails", acNormal, , , acFormReadOnly, , "ID" & Me.ID
         

End Sub
what is the mistake
 
You are missing the equals sign. Try

DoCmd.OpenForm "frmVDetails", acNormal, , , acFormReadOnly, , "ID = " & Me.ID
 
I also tried adding = but still the same problem
 
I didn't notice that you had the condition in the openargs argument. If you want it as a where condition then try:

Code:
DoCmd.OpenForm "frmVDetails", acNormal, , "ID = " & Me.ID, acFormReadOnly


Otherwise the "frmVDetails" will have to have some code to do something with the passed openarg.
 
Thanks for your help actually you did a lot to me. I decided finally to solve my problem by creating one main form which is linked directly to the table and then I added some some forms do [Id] field is unique

Sent from my G-TiDE E77 using Tapatalk
 

Users who are viewing this thread

Back
Top Bottom