|
Prev: Price Update
Next: Multiple selections, checkboxes
From: johansf on 1 Jul 2008 11:42 Who can help me??? I would appreciate this. I'm trying to do a check on a table see below. But I get a Type mismatch error on the And "[Primary contact]= true" Can someone help me with this? the collum is a field where I reffer to. Private Sub Command68_Click() On Error GoTo Err_Command68_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Extra contacts" stLinkCriteria = "[HD ID]=" & "'" & Me![HD ID] & "'" And "[Primary contact]= true" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command68_Click: Exit Sub Err_Command68_Click: MsgBox Err.Description Resume Exit_Command68_Click
From: Douglas J. Steele on 1 Jul 2008 11:52 stLinkCriteria = "[HD ID]= '" & Me![HD ID] & "' And [Primary contact]= true" Exagerated for clarity, that's stLinkCriteria = "[HD ID]= ' " & Me![HD ID] & " ' And [Primary contact]= true" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "johansf" <u44617(a)uwe> wrote in message news:8680b532710fc(a)uwe... > Who can help me??? I would appreciate this. > I'm trying to do a check on a table see below. But I get a Type mismatch > error on the And "[Primary contact]= true" Can someone help me with this? > the collum is a field where I reffer to. > > > Private Sub Command68_Click() > On Error GoTo Err_Command68_Click > > Dim stDocName As String > Dim stLinkCriteria As String > > stDocName = "Extra contacts" > > stLinkCriteria = "[HD ID]=" & "'" & Me![HD ID] & "'" And "[Primary > contact]= true" > DoCmd.OpenForm stDocName, , , stLinkCriteria > > Exit_Command68_Click: > Exit Sub > > Err_Command68_Click: > MsgBox Err.Description > Resume Exit_Command68_Click >
From: johansf on 1 Jul 2008 12:12 Thanks for the fast response. But still not working. Let me explain what I want to do. I have a table with details and lets say I have following records in it HD ID Name Primare UK jojo Yes or No tickbox UK didi Yes or No tickbox UK rere Yes or No tickbox IST qsqs Yes or No tickbox The tickboxes from the same HD ID only one of them can be YES the other are always NO. So what I try to do is I have a form that shows me the primary HD ID so with tick box YES. In that form I have a button to show the rest of them. So if I click that I want to see the other names frm that HD ID but with the NO tickbox. Douglas J. Steele wrote: >stLinkCriteria = "[HD ID]= '" & Me![HD ID] & "' And [Primary contact]= true" > >Exagerated for clarity, that's > >stLinkCriteria = "[HD ID]= ' " & Me![HD ID] & " ' And [Primary contact]= >true" > >> Who can help me??? I would appreciate this. >> I'm trying to do a check on a table see below. But I get a Type mismatch >[quoted text clipped - 19 lines] >> MsgBox Err.Description >> Resume Exit_Command68_Click
From: Douglas J. Steele on 2 Jul 2008 07:36 If you want to see the ones which aren't the primary (i.e.: those where primary contact is False), you should use = False, not = True in your criteria. However, if the name of the field in the table is Primare, that's the name that should be in your criteria, not [Primary contact]. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "johansf" <u44617(a)uwe> wrote in message news:8680f6cfe2133(a)uwe... > Thanks for the fast response. But still not working. > Let me explain what I want to do. > > I have a table with details and lets say I have following records in it > > HD ID Name Primare > UK jojo Yes or No tickbox > UK didi Yes or No tickbox > UK rere Yes or No tickbox > IST qsqs Yes or No tickbox > > The tickboxes from the same HD ID only one of them can be YES the other > are > always NO. > > So what I try to do is I have a form that shows me the primary HD ID so > with > tick box YES. > In that form I have a button to show the rest of them. So if I click that > I > want to see the other names frm that HD ID but with the NO tickbox. > > > > Douglas J. Steele wrote: >>stLinkCriteria = "[HD ID]= '" & Me![HD ID] & "' And [Primary contact]= >>true" >> >>Exagerated for clarity, that's >> >>stLinkCriteria = "[HD ID]= ' " & Me![HD ID] & " ' And [Primary contact]= >>true" >> >>> Who can help me??? I would appreciate this. >>> I'm trying to do a check on a table see below. But I get a Type mismatch >>[quoted text clipped - 19 lines] >>> MsgBox Err.Description >>> Resume Exit_Command68_Click >
|
Pages: 1 Prev: Price Update Next: Multiple selections, checkboxes |