I have created a Form which will add the student's details in DBF. The DBF field names are stud_fnme, stud_mnme, stud_lnme, stud_dob etc. there are total 30 fields.
I want, once entering the details in the form, the input details to be added to the DBF
- Add one blank record in the DBF (append blank)
- Replace all the respective fields with entered details.
I am not able to do this.
I have tried by doing this following code
Sele A
Use Stud_mast
Index on Admn_numb Tag adnum
append blank
replace stud_nme with Fname
- stud_fnme is DBF field name
- fname is the Form field Name
That is not the way of doing that (append blank and then replace). Instead, on your form place the controls with controlsources set to corresponding fields. An easy way of doing this:
Now if you append blank, you would be directly editing the fields in table.
For greater control you would want to enable table buffering so you would decide in code to commit or revert the changes.
PS: When you need Append blank and then replace, consider using INSERT INTO - SQL instead.