G
Gaby Sandoval
hi everyone,
I really need help. Trying to get this simple form to work for a
meeting tomorrow.
I have 2 tables with data -- company, roles. each table has the name
and a corresponding code
I have form that ask for your name, what company you are from (list) ,
and your role (also a list selection) at the meeting.
I then want generate a unique number for that participant. the unique
number is 7 digits (xxyyzzz)
xx= role code, yy=company code, zzz=sequential number (based on the
role)
i built the form. it has two buttons that both need to run some sql
to accomplish my task.
here is my vb code (i commented out things i am not sure how to get
working). i think by reading it you can see what i am trying to
accomplish, but cant get to work. please help. i appreciate any
advice....
-----
Dim OrgName As String
Dim RoleName As String
Dim UniqueId As String
Dim LastName As String
Dim FirstName As String
Dim TotalNumber As String
Private Sub btnGenerate_Click()
UserRoleNum = lstRole.Value
UserOrgNum = lstOrg.Value
' SELECT Count(ParticipantRole) AS [TotalNumber] FROM Roster WHERE
((Roster.participantrole)=[UserRoleNum]);"
TotalNumber = TotalNumber + 1
' Total number needs to be formated as three digits - Ex: 001, 002,
Me.txtUnique = UserOrgNum & UserRoleNum & TotalNumber
UniqueId = txtUnique.Value
End Sub
Private Sub btnCreate_Click()
' LastName = txtLastName.Value
' FirstName = txtFirstName.Value
'SELECT organization.comp AS [OrgName] , organization.number AS
[OrgNum]FROM organization WHERE organization.number = [UserOrgNum];
' SELECT roles.comp AS [RoleName] , roles.number AS [RoleNum]FROM
roles WHERE roles.number = [UserRoleNum];
'INSERT INTO roster (lastname, firstname, organization,
organizationname, participantrole, participantrolename, uniqueID)
VALUES ([LastName], [FirstName], [OrgNum], [OrgName], [RoleNum],
[RoleName], [UniqueID])
End Sub
I really need help. Trying to get this simple form to work for a
meeting tomorrow.
I have 2 tables with data -- company, roles. each table has the name
and a corresponding code
I have form that ask for your name, what company you are from (list) ,
and your role (also a list selection) at the meeting.
I then want generate a unique number for that participant. the unique
number is 7 digits (xxyyzzz)
xx= role code, yy=company code, zzz=sequential number (based on the
role)
i built the form. it has two buttons that both need to run some sql
to accomplish my task.
here is my vb code (i commented out things i am not sure how to get
working). i think by reading it you can see what i am trying to
accomplish, but cant get to work. please help. i appreciate any
advice....
-----
Dim OrgName As String
Dim RoleName As String
Dim UniqueId As String
Dim LastName As String
Dim FirstName As String
Dim TotalNumber As String
Private Sub btnGenerate_Click()
UserRoleNum = lstRole.Value
UserOrgNum = lstOrg.Value
' SELECT Count(ParticipantRole) AS [TotalNumber] FROM Roster WHERE
((Roster.participantrole)=[UserRoleNum]);"
TotalNumber = TotalNumber + 1
' Total number needs to be formated as three digits - Ex: 001, 002,
Me.txtUnique = UserOrgNum & UserRoleNum & TotalNumber
UniqueId = txtUnique.Value
End Sub
Private Sub btnCreate_Click()
' LastName = txtLastName.Value
' FirstName = txtFirstName.Value
'SELECT organization.comp AS [OrgName] , organization.number AS
[OrgNum]FROM organization WHERE organization.number = [UserOrgNum];
' SELECT roles.comp AS [RoleName] , roles.number AS [RoleNum]FROM
roles WHERE roles.number = [UserRoleNum];
'INSERT INTO roster (lastname, firstname, organization,
organizationname, participantrole, participantrolename, uniqueID)
VALUES ([LastName], [FirstName], [OrgNum], [OrgName], [RoleNum],
[RoleName], [UniqueID])
End Sub