Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / September 2005

Tip: Looking for answers? Try searching our database.

Open a form for specific record.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AhmtDY - 30 Sep 2005 08:09 GMT
I did it many times but now I forgot it and cannot open a form for a specific
value.
There was a method that create the following code automatically.  We can
match the values and even determine the picture or text on the toggle button
with that method . Please help.

Private Sub Command19_Click()
On Error GoTo Err_Command19_Click

   Dim stDocName As String
   Dim stLinkCriteria As String

   stDocName = "Form"
   
   stLinkCriteria = "[PARTNO]=" & "'" & Me![Combo5] & "'"
   DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command19_Click:
   Exit Sub

Err_Command19_Click:
   MsgBox Err.DESCRIPTION
   Resume Exit_Command19_Click
   
End Sub
Ofer - 30 Sep 2005 08:51 GMT
If the Part No field is number you should try this
stLinkCriteria = "[PARTNO]=" & Me![Combo5]
DoCmd.OpenForm stDocName, , , stLinkCriteria
===================================
If the Part No field is text you should try this
stLinkCriteria = "[PARTNO]= '" & Me![Combo5] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
===================================
If the Part No, is not the first column in the combo, then you  should
specify the column number
stLinkCriteria = "[PARTNO]= '" & Me![Combo5].column(1) & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
'the column number start with 0
Signature

I hope that helped
Good luck

> I did it many times but now I forgot it and cannot open a form for a specific
> value.
[quoted text clipped - 21 lines]
>    
> End Sub
Ofer - 30 Sep 2005 08:59 GMT
One more thing, if the form name is "form", it a word that bean used by
access, you better change the name, it can cause to some problems
Signature

I hope that helped
Good luck

> I did it many times but now I forgot it and cannot open a form for a specific
> value.
[quoted text clipped - 21 lines]
>    
> End Sub
AhmtDY - 30 Sep 2005 10:23 GMT
Thank you but threre is a tool for dummies(I used to know and use many times,
but I forgot).  Not a code. It creates that code. I will go to mad.

> One more thing, if the form name is "form", it a word that bean used by
> access, you better change the name, it can cause to some problems
[quoted text clipped - 24 lines]
> >    
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.