-
Jan 28th, 2000, 01:06 AM
#1
Thread Starter
New Member
As I am a bit of a novice to VB I need help with the following problem. I have a form to add new members to my membership table in a database. The form contains text boxes that write to the table via a command button. One of the text boxes is for 'Membership Number'. I want this text box to automatically come up with the next available number when I open the form. I'm sure that this is a fairly simple question, but I am new to the subject!
-
Jan 28th, 2000, 01:11 AM
#2
Hyperactive Member
dim rcdTable as recordset, dbsData as database
set dbsData = opendatabase("database.mdb")
set rcdtable = dbsdata.openrecordset("select MembreNumber from table")
rcdtable.movelast
if rcdtable("MemberNumber") <> "" then
txtmember.text = cint(rcdtable("MemberNumber")) + 1
else
txtmember.text = "1"
end if
rcdtable.close
dbsdata.close
Here you go, you have to change variable names etc but it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|