Hello
When using DLOOKUP with combined fields. How can I display the fields Mask
Dlookup("field1","&msg&","field2","tblName","id=" & me.id)
Sent from my SM-J701F using Tapatalk
Hello
When using DLOOKUP with combined fields. How can I display the fields Mask
Dlookup("field1","&msg&","field2","tblName","id=" & me.id)
Sent from my SM-J701F using Tapatalk
Does that even work?
DLookup has 3 arguments - Field, Table, and Criteria.
that still won't work
you want something like
Dlookup("[LookupField]", "tblTableName", "[Field1] = " & NumberValue & " AND [Field2] = '" & TextValue & "'")
in this example I've showed you how to look up both a number and a text value, note text values need to be enclosed in ' or " marks, but if you use " marks you'll need to double them up
Dlookup("[LookupField]", "tblTableName", "[Field1] = " & NumberValue & " AND [Field2] = """ & TextValue & """")
Thank you. Now in this statement, how to display the Inputmask fieldthat still won't work
you want something like
Dlookup("[LookupField]", "tblTableName", "[Field1] = " & NumberValue & " AND [Field2] = '" & TextValue & "'")
in this example I've showed you how to look up both a number and a text value, note text values need to be enclosed in ' or " marks, but if you use " marks you'll need to double them up
Dlookup("[LookupField]", "tblTableName", "[Field1] = " & NumberValue & " AND [Field2] = """ & TextValue & """")
Sent from my SM-J701F using Tapatalk
Not sure what your trying to accomplish with an input mask and a dlookup.
An input mask is used to guide input into a field.
Are you trying to format the output? What type of data are you working with? What is msg?
What should the output look like?
format(Dlookup("[LookupField]", "tblTableName", "[Field1] = " & NumberValue & " AND [Field2] = '" & TextValue & "'"), "FORMAT NAME HERE")
in response to moke123, dlookup removes formatting, for instance a dlookup on a currency field would remove the currency symbol, which means you have to re-insert the formatting as necessary. Dlookup also tends to make everything a text field or be evaluated as a text field which isn't always what you want.
Okay.You are right but Sometimes it is necessary to bring two or more fields to a single-textbox, how to display an extension of one of the fields that are inputmaskin response to moke123, dlookup removes formatting, for instance a dlookup on a currency field would remove the currency symbol, which means you have to re-insert the formatting as necessary. Dlookup also tends to make everything a text field or be evaluated as a text field which isn't always what you want.
Sent from my SM-J701F using Tapatalk
not a clue what you're asking with your last post. Perhaps if you post an example of what your data looks like and what you want your result to be.
Excuse me, I do not have access to the computer now, so I can not post exactly the phrase for you, I put fields in the combination by DLOOKUP in a single screen, but I could not display the format of one of the fields that was inputmask
Sent from my SM-J701F using Tapatalk
Inside the MobileNo Field in the Table. there is some Signs (input mask). I am going to display them in theTextBoxExcuse me, I do not have access to the computer now, so I can not post exactly the phrase for you, I put fields in the combination by DLOOKUP in a single screen, but I could not display the format of one of the fields that was inputmask
Sent from my SM-J701F using Tapatalk
MyTxtBox= DLookup("[Name] &"" "" & [MobileNo]", "tblEmployee", "[EmployeeID]=" & Me.EmployeeID)*
Sent from my SM-J701F using Tapatalk
Inside the MobileNo Field in the Table. there is some Signs (input mask). I am going to display them in theTextBoxExcuse me, I do not have access to the computer now, so I can not post exactly the phrase for you, I put fields in the combination by DLOOKUP in a single screen, but I could not display the format of one of the fields that was inputmask
Sent from my SM-J701F using Tapatalk
MyTxtBox= DLookup("[Name] &"" "" & [MobileNo]", "tblEmployee", "[EmployeeID]=" & Me.EmployeeID)
Sent from my SM-J701F using Tapatalk
I think I understand. If you use the input mask wizard it gives you the option to store the mask characters - ie. (___)___-____ in the table.
to get the name and phone number in a field you would concatenate them
Note that Name is a reserved word and you should not use it as a field name.
try
Code:MyTxtBox= DLookup("[Name]", "tblEmployee", "[EmployeeID]= " & Me.EmployeeID) & " " & DLookup("[MobileNo]", "tblEmployee", "[EmployeeID]= " & Me.EmployeeID)
Last edited by moke123; 05-23-2019 at 04:17 PM.