Modules or Functions

midge

Registered User.
Local time
Today, 11:07
Joined
Dec 15, 2002
Messages
21
I am new to using Access 2000 and VBA and I require some help in my project which I need to complete by Wednesday 8th January 2003.

I need to add three Sub Procedures or Functions to a Form Module and one Sub Procedure or Function to a Global Module.

The database tables and forms that I have already designed are as follows and are based on a football club :-

Committee Members fields :- MemberID, Position,FullName, Address, PostCode,TelephoneNo, MobileNo.

OutsideContacts :- CompanyID,CompanyName,MemberID, Address,PostCode,TelephoneNo,EMail, Category

Suppliers :- SupplierID, SupplierName,MemberID,Address,PostCode,TelephoneNo.EMail

Inventory :- ProductID,ProductName,Description,SupplierID,Unitsinstock,Reorderlevel

Players :- PlayerID,FullName,MemberID,Team,Address,PostCode,TelephoneNo,MobileNo.


Any ideas on where I can get find some code to help with my problem, or any code which you know may help me would be much appreciated.

Regards,

Midge
 
Modules & Functions

Hi,

I am using Access 2000 version.

I decided to use the following code to search for a record in the Players form which contains the following fields :-

Players :- PlayerID,FullName,MemberID,Team,Address,PostCode,T
elephoneNo,MobileNo.

I created a button called FindRecord but I did not use the wizard to create the button.

Private Sub FindRecord_Click()


Dim rst As ADODB.Recordset, strCriteria As String
strCriteria = "[FullName] Like '*" & InputBox("Enter the " _
& "first few letters of the name to find") & "*'"

Set rst = Me.RecordsetClone
rst.FindFirst strCriteria
If rst.NoMatch Then
MsgBox "No entry found"
Else
Me.Bookmark = rst.Bookmark
End If

End Sub


After I clicked on the button that I created the following error occurred :-

COMPILE ERROR :-

Method or Data Member not found

Any help to solve this problem would be much appreciated
 
Modules & Functions

Hi,

The part which was highlighted when I clicked on the FindRecord was FindFirst.

Regards,
 
seek and you shall find, all the answers to your problems lie within this forum.....
 
You almost certainly have a Missing Reference, search here for more specific help
 
Although I haven't really used Access 2000 (still a '97 user) I was wondering if the problem may be that you haven't specified which database the recordset belongs to.

In '97 we would use:

Dim db as Database, rs as RecordSet
Set db = CurrentDb
Set rs = db.OpenRecordset("tblExample")


So, I'm just suggesting that you haven't specified the database...
 
Modules & Functions

Hi,

Thanks for the feedback !!!

The code that I used was when I did a search on 'bookmark' on Microsoft Access 2000 help, and adjusted the code for my database. I created a button called "FindRecord" and copied the code.

So why does the code not work ?
 
Functions & Modules

Hi,

I have managed to sort out my problem concerning searching for a record by clicking on a button.

I had to make sure that Microsoft DAO 3.6 Objects was selected from the Tools then References.

Private Sub FindRecord_Click()

Dim rst As DAO.Recordset, strCriteria As String
strCriteria = "[FullName] Like '*" & InputBox("Enter the " _
& "first few letters of the name to find") & "*'"

Set rst = Me.RecordsetClone
rst.FindFirst strCriteria
If rst.NoMatch Then
MsgBox "No entry found"
Else
Me.Bookmark = rst.Bookmark
End If

End Sub

I hope that this code is useful to anyone else !!
 

Users who are viewing this thread

Back
Top Bottom