dlookup or not dlookup...

L

lula

hi.... I have a question... the other day "ofer" helped me with a dlookup
syntax and I have one more question...

I'm importing the fields of a word document into my database and I'm convert
each part of the word doc into the id value of my tables in my database.

ie: in the word doc I have urgency: average
in my database I have a Urgency table where the "average" id is 1.

and in code I'm grabbing that "average" and With the dlookup I look for the
"average" id, so it brings me the #: 1.

Now, here is the question... I have 2 fields in my database that are Yes/No
fields. how do I do it with those 2 fields???

I hope someone understand what I need and can help me.....

thank you for your help in advance!
 
O

Ofer

I'm not sure if you want to return this two fields, or filter on them

To return to fields combined, you can use the dlookup as follows

=DlookUp("[Field1] & [Field2]","TableName","Field1='Value'")
===========================================
To filter on a Yes/No field
=DlookUp("[Field1]","TableName","Field1=True")
Or , use false
===========================================
To filter on two fields on the same time
=DlookUp("[Field1]","TableName","Field1='Value' And Field2 = True")

or with parameter
=DlookUp("[Field1]","TableName","Field1='" & Value & "' And Field2 = True")

Mybe one of the example answered your question, or if Im in the right
direction then please tell me if you need any more help
 
L

lula

thank you ofer for your help, but actually I don't know what I need.. jaja.

let me explain myself again, cos I don't think it's any of the options you
gave me.

I have a word doc for computer repair requests with formfields where the
people choose an option from. (ie: urgency could be: low, average or high)
In my database, I have tables that codifies those options (Urgency table has
id_urgency and desc_urgency)

so far I'm trying to grab those formfields like this:

Dim strUrgency As String
Dim lngUrgency As Long

'Get the contents of the formfields
strUrgency = oDoc.FormFields("Dropdown5").Result

'Get UrgencyId from Urgency Name by looking it up
lngUrgency = DLookup("[id_urgency]", "Urgency", "[desc_urgency] = '"
& strUrgency & "'")

ok. the question is that one of the formfields says if this was the first
time that happened to the machine (as it is a computer repair request), so
they can choose Yes or no. Now, in my main table for the database, this field
is a Yes/No field. so, I'm not sure if I can set it as the other ones (string
- long) or what is the correct "dim" that I have to put to that variable so
when I add a new record afterwards to my database that field is checked if it
says yes, and it is not checked if it says no....

then I have to see how I deal with the adding records part, but John Nurick
was helping me with that, although I'm having trouble with that as well...
jaja.

hope this was a little bit more explainatory, so you can help me again!

thank you again for taking your time to help me. I really appreciate it.




Ofer said:
I'm not sure if you want to return this two fields, or filter on them

To return to fields combined, you can use the dlookup as follows

=DlookUp("[Field1] & [Field2]","TableName","Field1='Value'")
===========================================
To filter on a Yes/No field
=DlookUp("[Field1]","TableName","Field1=True")
Or , use false
===========================================
To filter on two fields on the same time
=DlookUp("[Field1]","TableName","Field1='Value' And Field2 = True")

or with parameter
=DlookUp("[Field1]","TableName","Field1='" & Value & "' And Field2 = True")

Mybe one of the example answered your question, or if Im in the right
direction then please tell me if you need any more help

--
I hope that helped
Good Luck


lula said:
hi.... I have a question... the other day "ofer" helped me with a dlookup
syntax and I have one more question...

I'm importing the fields of a word document into my database and I'm convert
each part of the word doc into the id value of my tables in my database.

ie: in the word doc I have urgency: average
in my database I have a Urgency table where the "average" id is 1.

and in code I'm grabbing that "average" and With the dlookup I look for the
"average" id, so it brings me the #: 1.

Now, here is the question... I have 2 fields in my database that are Yes/No
fields. how do I do it with those 2 fields???

I hope someone understand what I need and can help me.....

thank you for your help in advance!
 
O

Ofer

You define this field as
Dim MyVar As Boolean

And the field in the table will return True Or False

MyVar = Dlookup("YesNoField","TableName","Where condtion")
If MyVar = True Then
' checked
else
' Not checked
End if


--
I hope that helped
Good Luck


lula said:
thank you ofer for your help, but actually I don't know what I need.. jaja.

let me explain myself again, cos I don't think it's any of the options you
gave me.

I have a word doc for computer repair requests with formfields where the
people choose an option from. (ie: urgency could be: low, average or high)
In my database, I have tables that codifies those options (Urgency table has
id_urgency and desc_urgency)

so far I'm trying to grab those formfields like this:

Dim strUrgency As String
Dim lngUrgency As Long

'Get the contents of the formfields
strUrgency = oDoc.FormFields("Dropdown5").Result

'Get UrgencyId from Urgency Name by looking it up
lngUrgency = DLookup("[id_urgency]", "Urgency", "[desc_urgency] = '"
& strUrgency & "'")

ok. the question is that one of the formfields says if this was the first
time that happened to the machine (as it is a computer repair request), so
they can choose Yes or no. Now, in my main table for the database, this field
is a Yes/No field. so, I'm not sure if I can set it as the other ones (string
- long) or what is the correct "dim" that I have to put to that variable so
when I add a new record afterwards to my database that field is checked if it
says yes, and it is not checked if it says no....

then I have to see how I deal with the adding records part, but John Nurick
was helping me with that, although I'm having trouble with that as well...
jaja.

hope this was a little bit more explainatory, so you can help me again!

thank you again for taking your time to help me. I really appreciate it.




Ofer said:
I'm not sure if you want to return this two fields, or filter on them

To return to fields combined, you can use the dlookup as follows

=DlookUp("[Field1] & [Field2]","TableName","Field1='Value'")
===========================================
To filter on a Yes/No field
=DlookUp("[Field1]","TableName","Field1=True")
Or , use false
===========================================
To filter on two fields on the same time
=DlookUp("[Field1]","TableName","Field1='Value' And Field2 = True")

or with parameter
=DlookUp("[Field1]","TableName","Field1='" & Value & "' And Field2 = True")

Mybe one of the example answered your question, or if Im in the right
direction then please tell me if you need any more help

--
I hope that helped
Good Luck


lula said:
hi.... I have a question... the other day "ofer" helped me with a dlookup
syntax and I have one more question...

I'm importing the fields of a word document into my database and I'm convert
each part of the word doc into the id value of my tables in my database.

ie: in the word doc I have urgency: average
in my database I have a Urgency table where the "average" id is 1.

and in code I'm grabbing that "average" and With the dlookup I look for the
"average" id, so it brings me the #: 1.

Now, here is the question... I have 2 fields in my database that are Yes/No
fields. how do I do it with those 2 fields???

I hope someone understand what I need and can help me.....

thank you for your help in advance!
 
L

lula

thank you ofer for your help.... that's what I needed. Now, really forgive me
for this new stupid question, but, how do I put that checked?? do I just
write down that 'checked??? jajaja... I have no idea how to do that... sorry.
I know that's too easy, but I don't know how to do it.


thank you again for helping me.

lula

Ofer said:
You define this field as
Dim MyVar As Boolean

And the field in the table will return True Or False

MyVar = Dlookup("YesNoField","TableName","Where condtion")
If MyVar = True Then
' checked
else
' Not checked
End if


--
I hope that helped
Good Luck


lula said:
thank you ofer for your help, but actually I don't know what I need.. jaja.

let me explain myself again, cos I don't think it's any of the options you
gave me.

I have a word doc for computer repair requests with formfields where the
people choose an option from. (ie: urgency could be: low, average or high)
In my database, I have tables that codifies those options (Urgency table has
id_urgency and desc_urgency)

so far I'm trying to grab those formfields like this:

Dim strUrgency As String
Dim lngUrgency As Long

'Get the contents of the formfields
strUrgency = oDoc.FormFields("Dropdown5").Result

'Get UrgencyId from Urgency Name by looking it up
lngUrgency = DLookup("[id_urgency]", "Urgency", "[desc_urgency] = '"
& strUrgency & "'")

ok. the question is that one of the formfields says if this was the first
time that happened to the machine (as it is a computer repair request), so
they can choose Yes or no. Now, in my main table for the database, this field
is a Yes/No field. so, I'm not sure if I can set it as the other ones (string
- long) or what is the correct "dim" that I have to put to that variable so
when I add a new record afterwards to my database that field is checked if it
says yes, and it is not checked if it says no....

then I have to see how I deal with the adding records part, but John Nurick
was helping me with that, although I'm having trouble with that as well...
jaja.

hope this was a little bit more explainatory, so you can help me again!

thank you again for taking your time to help me. I really appreciate it.




Ofer said:
I'm not sure if you want to return this two fields, or filter on them

To return to fields combined, you can use the dlookup as follows

=DlookUp("[Field1] & [Field2]","TableName","Field1='Value'")
===========================================
To filter on a Yes/No field
=DlookUp("[Field1]","TableName","Field1=True")
Or , use false
===========================================
To filter on two fields on the same time
=DlookUp("[Field1]","TableName","Field1='Value' And Field2 = True")

or with parameter
=DlookUp("[Field1]","TableName","Field1='" & Value & "' And Field2 = True")

Mybe one of the example answered your question, or if Im in the right
direction then please tell me if you need any more help

--
I hope that helped
Good Luck


:

hi.... I have a question... the other day "ofer" helped me with a dlookup
syntax and I have one more question...

I'm importing the fields of a word document into my database and I'm convert
each part of the word doc into the id value of my tables in my database.

ie: in the word doc I have urgency: average
in my database I have a Urgency table where the "average" id is 1.

and in code I'm grabbing that "average" and With the dlookup I look for the
"average" id, so it brings me the #: 1.

Now, here is the question... I have 2 fields in my database that are Yes/No
fields. how do I do it with those 2 fields???

I hope someone understand what I need and can help me.....

thank you for your help in advance!
 
O

Ofer

Hi, sorry it took me such a long time to reply, I've been away.
Do you still need help with that problem
--


lula said:
thank you ofer for your help.... that's what I needed. Now, really forgive me
for this new stupid question, but, how do I put that checked?? do I just
write down that 'checked??? jajaja... I have no idea how to do that... sorry.
I know that's too easy, but I don't know how to do it.


thank you again for helping me.

lula

Ofer said:
You define this field as
Dim MyVar As Boolean

And the field in the table will return True Or False

MyVar = Dlookup("YesNoField","TableName","Where condtion")
If MyVar = True Then
' checked
else
' Not checked
End if


--
I hope that helped
Good Luck


lula said:
thank you ofer for your help, but actually I don't know what I need.. jaja.

let me explain myself again, cos I don't think it's any of the options you
gave me.

I have a word doc for computer repair requests with formfields where the
people choose an option from. (ie: urgency could be: low, average or high)
In my database, I have tables that codifies those options (Urgency table has
id_urgency and desc_urgency)

so far I'm trying to grab those formfields like this:

Dim strUrgency As String
Dim lngUrgency As Long

'Get the contents of the formfields
strUrgency = oDoc.FormFields("Dropdown5").Result

'Get UrgencyId from Urgency Name by looking it up
lngUrgency = DLookup("[id_urgency]", "Urgency", "[desc_urgency] = '"
& strUrgency & "'")

ok. the question is that one of the formfields says if this was the first
time that happened to the machine (as it is a computer repair request), so
they can choose Yes or no. Now, in my main table for the database, this field
is a Yes/No field. so, I'm not sure if I can set it as the other ones (string
- long) or what is the correct "dim" that I have to put to that variable so
when I add a new record afterwards to my database that field is checked if it
says yes, and it is not checked if it says no....

then I have to see how I deal with the adding records part, but John Nurick
was helping me with that, although I'm having trouble with that as well...
jaja.

hope this was a little bit more explainatory, so you can help me again!

thank you again for taking your time to help me. I really appreciate it.




:

I'm not sure if you want to return this two fields, or filter on them

To return to fields combined, you can use the dlookup as follows

=DlookUp("[Field1] & [Field2]","TableName","Field1='Value'")
===========================================
To filter on a Yes/No field
=DlookUp("[Field1]","TableName","Field1=True")
Or , use false
===========================================
To filter on two fields on the same time
=DlookUp("[Field1]","TableName","Field1='Value' And Field2 = True")

or with parameter
=DlookUp("[Field1]","TableName","Field1='" & Value & "' And Field2 = True")

Mybe one of the example answered your question, or if Im in the right
direction then please tell me if you need any more help

--
I hope that helped
Good Luck


:

hi.... I have a question... the other day "ofer" helped me with a dlookup
syntax and I have one more question...

I'm importing the fields of a word document into my database and I'm convert
each part of the word doc into the id value of my tables in my database.

ie: in the word doc I have urgency: average
in my database I have a Urgency table where the "average" id is 1.

and in code I'm grabbing that "average" and With the dlookup I look for the
"average" id, so it brings me the #: 1.

Now, here is the question... I have 2 fields in my database that are Yes/No
fields. how do I do it with those 2 fields???

I hope someone understand what I need and can help me.....

thank you for your help in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top