Question : create a access database with information from a spreadsheet and print to index cards

Hi,

I have a excel spreadsheet with the following columns
account number
title
name
address
phone
donation yr X

I need to import this into an access database...(this i can do)
I then want to add another field with "moderator"
After that I need to create a form to allow users moderators to view their accounts
Also I want to be able to print out an index card with all the fields for an account.....and do it in batch so I could print 100 accounts at once.. This way we can hand the cards out to the moderators for them to work off of

Any idea how to do this?

Answer : create a access database with information from a spreadsheet and print to index cards

I'm glad you got the printing solved :-)

For the authentication, it depends on the level of security you want.  A very simple method (but one that would protect you only from honest people) would me as follows:

1. Create a table of moderators with four fields:
   ModID (autonumber - primary key)
  ModName (text)
  ModUser (text, no duplicates)
  ModPwd (text)

For ModPwd, set the InputMask property to Password.  Populate this with the names of the moderators, their unique usernames, and passwords.

2. Create an unbound form (no record source) with two textboxes.(txtUser and txtPwd) and two command buttons (cmdOK and cmdCancel).  Set the Input mask of txtPwd to Password, and the captions of the command buttons to OK and Cancel.

3. Paste the code in the snippet below into the form's module.

4. Set the form's Modal and Popup properties to Yes.

5. Save the form and name it frmLogin

6. Create a module and add this procedure:

Public Function CurrentModerator() as Long
On Error Resume Next
CurrentModerator = Forms!frmLogin.CurrentModerator
End Function

7. Go to Tools > Startup and set frmLogin as the startup form.

--
Graham

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
Option Explicit
Option Compare Binary
 
Public CurrentModerator as Long
 
Private Sub cmdCancel_Click()
Application.Quit
End Sub
 
Private Sub cmdOK_Click()
Dim ModID as Long
Dim rs as DAO.Recordset
On Error Goto ProcErr
  if IsNull(txtUser) Then
    txtPwd = Null
    txtUser.Setfocus
    MsgBox "Please enter your username"
    Goto ProcEnd
  End If
  if IsNull(txtPwd) Then
    txtPwd.Setfocus
    MsgBox "Please enter your password"
    Goto ProcEnd
  End If
  Set rs = CurrentDb.OpenRecordset("Select * from Moderators where ModUser=""" _
        & txtUser & """", dbOpenForwardOnly)
  if rs.EOF then
    txtUser.Setfocus
    MsgBox "Unknown username"
    Goto ProcEnd
  End if
  If txtPwd = rs!ModPwd Then
    Currentmoderator = rs!ModID
    Me.Visible = false
    ' maybe open your form to view the accounts here
  Else
    txtUser.Setfocus
    MsgBox "Incorrect password"
  End If   
ProcEnd:
  On Error Resume Next
  If Not rs is nothing then
    rs.Close
    Set rs = nothing
  End If
  Exit Sub
ProcErr:
  MsgBox Err.Description
  Resume ProcEnd
End Sub
 
Private Sub Form_Unload()
Application.Quit
End Sub
Random Solutions  
 
programming4us programming4us