L
Lisa B.
Is there a way to only pass two(2) arguements to a function if the function
is waiting for five(5)
1. For example I have a function that adds a record to a table.
2. On a form the user inputs First Name, Last Name, type, Title, and Level
3. First Name and Last Name are required fields
4. I don't want Type, Title. or Level to be required (they should be
optional inputs)
5. the user presses a button that calls the following function
Public Function NewRecruit(first, last, Otype, Title, Level As
String)
6. the code behind the button looks like this
NewRecruit Me![txtFName], Me![txtLName], Me![txtType],
Me![txtTitle], Me![txtLevel]
7. an error is generated if the user only inputs the first and last name
**Invalid use of Null***
8. the code for the function is as follows
Set TheDB = CurrentDb
Set SourceRS = TheDB.OpenRecordset("tblRecruitment", dbOpenDynaset)
With SourceRS
.AddNew
!CommunityID = GLBL_Community
!OfficialType = Otype
!OfficialLevel = Level
!Title = Title
!FName = first
!LName = last
.Update
.Bookmark = .LastModified
End With
RecruitID = SourceRS![OfficialID]
SourceRS.Close
is waiting for five(5)
1. For example I have a function that adds a record to a table.
2. On a form the user inputs First Name, Last Name, type, Title, and Level
3. First Name and Last Name are required fields
4. I don't want Type, Title. or Level to be required (they should be
optional inputs)
5. the user presses a button that calls the following function
Public Function NewRecruit(first, last, Otype, Title, Level As
String)
6. the code behind the button looks like this
NewRecruit Me![txtFName], Me![txtLName], Me![txtType],
Me![txtTitle], Me![txtLevel]
7. an error is generated if the user only inputs the first and last name
**Invalid use of Null***
8. the code for the function is as follows
Set TheDB = CurrentDb
Set SourceRS = TheDB.OpenRecordset("tblRecruitment", dbOpenDynaset)
With SourceRS
.AddNew
!CommunityID = GLBL_Community
!OfficialType = Otype
!OfficialLevel = Level
!Title = Title
!FName = first
!LName = last
.Update
.Bookmark = .LastModified
End With
RecruitID = SourceRS![OfficialID]
SourceRS.Close