Cfront findrec problem

vyankuvyanku Member Posts: 791
I create a application in VB having textbox-findcust and button search.
Private Sub Command1_Click()
findcust1 = findcust
cust = Customer
custTableId = 18
FIELDNO = 1
Call CFRONT2.OpenTable(cust, custTableId)
custrec = CFRONT2.AllocRec(cust)
[b]tmpvar = CFRONT2.FindRec(cust, custrec, findcust1)[/b]
TxtCustName = CFRONT2.GetFieldData(cust, custrec, 2)
TxtCustNo = CFRONT2.GetFieldData(cust, custrec, 1)

End Sub
Problem is when I insert customer code in textbox and click on button bit it will not search that no. in customer table.
Please tell me how can write findrec so that I can search the inserted record from the table?

Comments

  • dmccraedmccrae Member, Microsoft Employee Posts: 144
    You first need to assign the customer number to the record, then find using the '=' search method, like:
    CFRONT2.AssignField(cust, custrec, 1, findcust1)
    tmpvar = CFRONT2.FindRec(cust, custrec, "=")
    

    This works for finding primary key values. Otherwise you need to use SetRange or SetFilter to first apply a filter, then use the "-" search method to get the first mathing record.
    Dean McCrae - Senior Software Developer, NAV Server & Tools

    This posting is provided "AS IS" with no warranties, and confers no rights.
Sign In or Register to comment.