I have a subform called loan_information with three LEs on it Load ID2 Payment Date Payments
and a parent form with the following LEs on it Loan ID1 Payment Date0 Payments0
and a button on the parent form which has the following code
ar n as Int var vCount as Int var vEdits as String var vDeletes as String var vChoice as String
If @Mode() < 2 { Clear(Loan ID1, Payment Date0, Payments0) //Clear the parent form Label(ThisElement, "Add / Edit / Delete Payment") //Labels button vCount = @FormResultSetTotal("loan_information") //Counts how many records in subform
If vCount = 1 Then If @FormFieldValue("loan_information", "Loan ID2", 1) = "" Then vCount = 0
For n = 1 to vCount vEdits = @AppendStringArray(vEdits, "Edit a Payment/Edit Payment Rec# " + n) vDeletes = @AppendStringArray(vDeletes, "Delete a Payment/Delete Payment Rec# " + n)
Next
PopupSelectPosition(4, @XPos(ThisElement), @YPos(ThisElement)) vChoice = @PopupMenu("Add a Payment;" + vEdits + ";" + vDeletes,"ADD, EDIT or DELETE A PAYMENT") // PopupSelectPosition(0,123,123)
If vChoice = "Add a Payment"
Label(ThisElement, vChoice) ForceRedraw() ThrowFocus(Loan ID) } Else If @Instr(vChoice, "Edit") > 0 and @Len(@Num(vChoice)) > 0 { Label(ThisElement, vChoice) ForceRedraw() Payment Date0 = @FormFieldValue("loan_information", "Payment Date", @Num(vChoice)) Payments0 = @FormFieldValue("loan_information", "Payments", @Num(vChoice)) Loan ID1 = @FormFieldValue("loan_information", "Loan ID2", @Num(vChoice)) ThrowFocus(Loan ID)
} Else If @Instr(vChoice, "Delete") > 0 and @Len(@Num(vChoice)) > 0 { Label(ThisElement, vChoice) ForceRedraw()
// Uncomment the following lines for Sesame 2.0
If @Askuser("Are you sure you want to delete record# " + @Num(vChoice) + "?","","") { FormDeleteRecord("loan_information", @Num(vChoice))
// CalcDonations() } Label(ThisElement, "Add / Edit / Delete Payment") ForceRedraw() }
I have been on this issue for the past two days, the problum is the Add Record works, and the menu works, but when i select another option, i the menu it do not work.
Help please,
|