Solved Intersection between Row and Column in access

FahadTiger

Member
Local time
Today, 19:33
Joined
Jun 20, 2021
Messages
120
Hi, I have table as shown ..and I have form with 3 textbox
txtID,txtField,txtResult
how can I get txtResult=125 when txtID=2 and txtField=field2
any suggest for that...thank you
 

Attachments

  • dd.PNG
    dd.PNG
    3.9 KB · Views: 71
you can use DLookup?

Dlookup("field2", "yourTableName", "ID = 2")
 
Use DlookUp()
 
You can use as the ControlSource of txtResult:
=DLookup([txtField], "YourTableName", "id = " & [txtID])
 
thank you all for reply...i used dlookup before but doing error because small mistak
Dim intID As Integer
Dim strField As String
intID = Me.txtID
strField = "Field" & Me.txtField
Me.txtResult = DLookup(strField, "MyTable", "ID=" & intID)
I used strField between double quotation..
and now its doing well
thank you
 
This all sounds like a horrible idea. It is a database not a spreadsheet. Show us your tables and explain what you are doing. The form should be bound an you move to the record
 

Users who are viewing this thread

Back
Top Bottom