Prev: How to set "licence" for Access 2007 database?
Next: Update of Existing Table Numeric Value Using DCount from Anoth
From: vaa571 on 12 Apr 2010 16:33 Hi there, i have a form where i would like to use for search by two criterias: Lot# or Part Number - these are two field in the table. need help to add that to the code Private Sub Command39_Click() End Sub Private Sub Command42_Click() On Error GoTo Err_Command42_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Open Orders" stLinkCriteria = "[PART NUMBER]=" & "'" & Me![PART NUMBER] & "'" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command42_Click: Exit Sub Err_Command42_Click: MsgBox Err.Description Resume Exit_Command42_Click End Sub Private Sub Command43_Click() DoCmd.Close DoCmd.OpenForm "Search & Update" End Sub
From: Douglas J. Steele on 12 Apr 2010 17:30 stLinkCriteria = "[PART NUMBER]='" & Me![PART NUMBER] & "' AND " & _ "[Lot#]='" & Me![Lot#] & "'" Incidentally, you'd be well advised to get rid of the # in your field name (as well as the spaces). Special characters cause more problems than they're worth! -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "vaa571" <vaa571(a)discussions.microsoft.com> wrote in message news:ABB7DD6B-1022-4D53-921E-F1D6BE8F17C8(a)microsoft.com... > Hi there, > > i have a form where i would like to use for search by two criterias: Lot# > or > Part Number - these are two field in the table. > need help to add that to the code > > Private Sub Command39_Click() > > End Sub > Private Sub Command42_Click() > On Error GoTo Err_Command42_Click > > Dim stDocName As String > Dim stLinkCriteria As String > > stDocName = "Open Orders" > > stLinkCriteria = "[PART NUMBER]=" & "'" & Me![PART NUMBER] & "'" > DoCmd.OpenForm stDocName, , , stLinkCriteria > > Exit_Command42_Click: > Exit Sub > > Err_Command42_Click: > MsgBox Err.Description > Resume Exit_Command42_Click > > End Sub > > Private Sub Command43_Click() > DoCmd.Close > DoCmd.OpenForm "Search & Update" > End Sub > > >
From: romildo on 14 Apr 2010 23:07
vai tomar no cúuuuuuuu "vaa571" <vaa571(a)discussions.microsoft.com> escreveu na notícia da mensagem:ABB7DD6B-1022-4D53-921E-F1D6BE8F17C8(a)microsoft.com... > Hi there, > > i have a form where i would like to use for search by two criterias: Lot# > or > Part Number - these are two field in the table. > need help to add that to the code > > Private Sub Command39_Click() > > End Sub > Private Sub Command42_Click() > On Error GoTo Err_Command42_Click > > Dim stDocName As String > Dim stLinkCriteria As String > > stDocName = "Open Orders" > > stLinkCriteria = "[PART NUMBER]=" & "'" & Me![PART NUMBER] & "'" > DoCmd.OpenForm stDocName, , , stLinkCriteria > > Exit_Command42_Click: > Exit Sub > > Err_Command42_Click: > MsgBox Err.Description > Resume Exit_Command42_Click > > End Sub > > Private Sub Command43_Click() > DoCmd.Close > DoCmd.OpenForm "Search & Update" > End Sub > > > |