From: kay on
mean while I solve previous problem, I am trying to create login form.
and here is the code I am using

on Login form I have two text box and 1 login button
UserName: txtUserNm
Password: txtPassword
-------------------------------------------------------------
Private Sub cmdLogin_Click()
On Error GoTo Err_cmdLogin_Click

Dim rs As DAO.Recordset
Dim strUser As String
Dim strPassword As String

txtUserNm.SetFocus
strUser = txtUserNm
txtPassword.SetFocus
strPassword = txtPassword

If Not IsNull(Me.txtUserNm) And Not IsNull(Me.txtPassword) Then
Set rs = CurrentDb.OpenRecordset("Select
tblEmpID.EmpID,tblEmpID.EmpPassword from tblEmpID where EmpID = '" & strUser
& "' And EmpPassword = '" & strPassword & "'", dbOpenSnapshot)

If rs.EOF Then
DoCmd.OpenForm "frmResourceV2"
Else
MsgBox "In Correct"
End If
End If
Exit_cmdLogin_Click:
Exit Sub

Err_cmdLogin_Click:
MsgBox Err.Description
Resume Exit_cmdLogin_Click

End Sub
----------------------------------------------------------------------------------
I was just checking that the code is working properly or not.
When I dont enter anything- it gives message " Invalid Use Of Null"
When I enter anything it opens the form without checking the values in the
table.

please help..
thanks.


"kay" wrote:

> Thanks for helping me out..
> I was trying these codes on the form,
> But when I enter the resourceID it does not show other information of ID in
> other txboxes and combo box fields.
> I created the button and add this code under event proc - DoCmd.GotoRecord,
> , acNewRec
> But this does not help to pop up other information of that ID – dateof
> followup, Comments,..etc
>
> "Jack Leach" wrote:
>
> > 1) disable all of the navigation buttons from the Properties of the form...
> > 2) provide an unbound textbox to use as a search box for an ID to jump to...
> > 3) provide a "New Record" button for them...
> >
> > One should be self explanitory... there is a property called "Navigation
> > Buttons" (or the like) which you will set to No. This removes the standard
> > nav buttons (and record counter that comes with it).
> >
> > Two is easy enough... but a button on the form, and in the Click event of
> > the button put this line of code:
> >
> > DoCmd.GotoRecord, , acNewRec
> >
> >
> > Three is a pretty standard operation as well. Use the Bookmark property of
> > a recordsetclone of the form to jump to the record, if found...
> >
> > Dim rs As DAO.Recordset
> > Set rs = Me.RecordsetClone
> > Me.ctlGoToTextbox.SetFocus
> > With rs
> > .FindFirst "[yourIDfield] = " & Nz(Me.ctlGotoCheckbox.Text, "")
> > If Not .NoMatch Then
> > Me.Bookmark = rs.Bookmark
> > Else
> > MsgBox "Record Not Found!"
> > End If
> > End With
> > Set rs = Nothing
> >
> >
> > Personally I use a textbox with a "Go" button next to it and set this code
> > to run from the Go button click or from the KeyDown event of the text box
> > (check for vbEnter).
> >
> > I believe this should accomplish what you seek... the users will be able to
> > go to add a record, or edit any record that is part of the recordset, but not
> > have the option to navigate the records (aside from entering every ID in the
> > search box), nor will they see how many records are in the set.
> >
> > hth
> >
> > --
> > Jack Leach
> > www.tristatemachine.com
> >
> > "I haven''t failed, I''ve found ten thousand ways that don''t work."
> > -Thomas Edison (1847-1931)
> >
> >
> >
> > "kay" wrote:
> >
> > > Sorry forgot to explain this point that
> > > frmResources - form will use by two group of people.
> > > 1. who will use this form to enter the data
> > > 2. who will uer this form to update the data.
> > >
> > > Thanks,
> > > -------------------------
> > >
> > > "kay" wrote:
> > >
> > > > Thanks for the quick reply.
> > > >
> > > > All these suggestions are helpful. But still that is not the solution I am
> > > > looking for.
> > > > As I do not want user to see how many and what records are there in the
> > > > table, but at the same time if they enter ResourceID (unique –PK) they should
> > > > be able to view the details for that ID. So its not about adding new data,
> > > > its about updating existing data and keeping track of the updates.
> > > > Data is already there in the table, user will be updating data and adding
> > > > comments to the table.
> > > > So here the picture of the form I am trying to design. (this is the simple
> > > > way I have not made fancy yet, once code and everything is set up, I will try
> > > > to look it fancy)
> > > > First – I have created the blank table 'tblResources' – data entry coming
> > > > from 'frmResources' will be stored in this table.
> > > > User will have access to 'frmResources'. So when they enter ID the related
> > > > fields details will pop up – comments, date, ..etc.
> > > > At the bottom of the form I have created two buttons – update and Exit.
> > > > So if user needs to update the information ( for eg. Update the comments)
> > > > they will change in the form and then when they click on update – it should
> > > > save the update into the table and whey they click on Exit – the
> > > > form(application) will just quit without saving the change.
> > > >
> > > > Sorry for making it complicated but this is what I am trying to design it.
> > > > appreciate your help.
> > > > Thanks
> > > >
> > > >
> > > > "Jack Leach" wrote:
> > > >
> > > > > set the DataEntry property of the form to True... this lets them add new
> > > > > records only and not view any existing ones.
> > > > >
> > > > > --
> > > > > Jack Leach
> > > > > www.tristatemachine.com
> > > > >
> > > > > "I haven''t failed, I''ve found ten thousand ways that don''t work."
> > > > > -Thomas Edison (1847-1931)
> > > > >
> > > > >
> > > > >
> > > > > "kay" wrote:
> > > > >
> > > > > > Thanks,
> > > > > > I tried this way but what happens that first time when the table was blank
> > > > > > it worked fine. when you enter data in forms it goes to table but next time
> > > > > > when you open the form it shows previous entries and that i do not want to
> > > > > > show to user.
> > > > > > they should not know what is there in the table.
> > > > > >
> > > > > > hope i am able to explain my point.
> > > > > >
> > > > > > "kismert" wrote:
> > > > > >
> > > > > > > You are working too hard. You want a "bound form" to do the work for you.
> > > > > > >
> > > > > > > You do this by binding the form to the table via a query:
> > > > > > > 1. Make a query, qryResources, which returns all the fields in table
> > > > > > > Resources, (Why? call it good practice)
> > > > > > > 2. In your form, set the Recordsource property to qryResources.
> > > > > > > 3. For each control in the form, set the Control Source to the appropriate
> > > > > > > field in the query.
> > > > > > >
> > > > > > > There! You now have a basic form that will read and write data to a table.
> > > > > > >
> > > > > > > Of course, there is a lot more twiddling you will want to do with the form
> > > > > > > properties to get something close to what you want, but I leave you with your
> > > > > > > perseverance and the trusty F1 key.
> > > > > > >
> > > > > > > -Ken
> > > > > > >
> > > > > > >
From: kay on
Thanks jeff for your suggestions.

currently I am working on Login form where I want user to enter username &
Password.
I am trying so many codes but not working.
I have tblEmpID - fields are : EmpName,EmpID,EmpPassword
I have tried two ways - 1. created a query to get EmpID and EmpPassword from
EmpID table whrer EmpID - criteria is forms!frmLogin!txtEmpID
2. ubbound taxboxes

but both ways are not working - I think i am doing some silly mistake in
writing code.

in my previous post i post the code which I tried earlier.
Please help to write the login code so when user click on the button, it
should valideate the valuse with the table and then open the main form.

Thanks



From: Jeff Boyce on
Please post what you are trying so we can offer our ideas on why it may/may
not work.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.


"kay" <kay(a)discussions.microsoft.com> wrote in message
news:8A4CC309-58F6-4B5E-A0C6-489FEA05A390(a)microsoft.com...
> Thanks jeff for your suggestions.
>
> currently I am working on Login form where I want user to enter username &
> Password.
> I am trying so many codes but not working.
> I have tblEmpID - fields are : EmpName,EmpID,EmpPassword
> I have tried two ways - 1. created a query to get EmpID and EmpPassword
> from
> EmpID table whrer EmpID - criteria is forms!frmLogin!txtEmpID
> 2. ubbound taxboxes
>
> but both ways are not working - I think i am doing some silly mistake in
> writing code.
>
> in my previous post i post the code which I tried earlier.
> Please help to write the login code so when user click on the button, it
> should valideate the valuse with the table and then open the main form.
>
> Thanks
>
>
>


From: kay on
I am creating a application to keep a track of resources
As I have explained in my previous post,
My main form – frmResources – which I will put as default form when user
opens the application.
This form will be used by to group of people – One group will use this form
to enter the data and other group will use same form to edit the data.

I am working on this form. In this form I have not make – DataEntry set to
“Yes” as this form will use to update the data as well.
Second form I am working on to create Login for users.

I have created table call tblEmpID which has fields such as
EmpID,EmpName,EmpPassword,EmpEmail,EmpDept.

In the Login form I have created two textboxes and 1 Login Button.
I have put code on click for login button . but its not working properly.
This code is not validating user info. What ever I enter it opens the main
form.
I have posted the code in my previous post. So I don't know what's wrong
with that code.

I am working on to create other forms as well, but first I want to get done
these two forms.

So please guide me. I don't mind starting from scratch.
Thanks!



"Jeff Boyce" wrote:

> Please post what you are trying so we can offer our ideas on why it may/may
> not work.
>
> Regards
>
> Jeff Boyce
> Microsoft Access MVP
>
> --
> Disclaimer: This author may have received products and services mentioned
> in this post. Mention and/or description of a product or service herein
> does not constitute endorsement thereof.
>
> Any code or pseudocode included in this post is offered "as is", with no
> guarantee as to suitability.
>
> You can thank the FTC of the USA for making this disclaimer
> possible/necessary.
>
>
> "kay" <kay(a)discussions.microsoft.com> wrote in message
> news:8A4CC309-58F6-4B5E-A0C6-489FEA05A390(a)microsoft.com...
> > Thanks jeff for your suggestions.
> >
> > currently I am working on Login form where I want user to enter username &
> > Password.
> > I am trying so many codes but not working.
> > I have tblEmpID - fields are : EmpName,EmpID,EmpPassword
> > I have tried two ways - 1. created a query to get EmpID and EmpPassword
> > from
> > EmpID table whrer EmpID - criteria is forms!frmLogin!txtEmpID
> > 2. ubbound taxboxes
> >
> > but both ways are not working - I think i am doing some silly mistake in
> > writing code.
> >
> > in my previous post i post the code which I tried earlier.
> > Please help to write the login code so when user click on the button, it
> > should valideate the valuse with the table and then open the main form.
> >
> > Thanks
> >
> >
> >
>
>
> .
>
From: Jeff Boyce on
Let me re-phrase ...

Please post the code you are trying.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"kay" <kay(a)discussions.microsoft.com> wrote in message
news:831C9FD4-76DA-487C-BB34-E02A76A99CBE(a)microsoft.com...
>I am creating a application to keep a track of resources
> As I have explained in my previous post,
> My main form - frmResources - which I will put as default form when user
> opens the application.
> This form will be used by to group of people - One group will use this
> form
> to enter the data and other group will use same form to edit the data.
>
> I am working on this form. In this form I have not make - DataEntry set
> to
> "Yes" as this form will use to update the data as well.
> Second form I am working on to create Login for users.
>
> I have created table call tblEmpID which has fields such as
> EmpID,EmpName,EmpPassword,EmpEmail,EmpDept.
>
> In the Login form I have created two textboxes and 1 Login Button.
> I have put code on click for login button . but its not working properly.
> This code is not validating user info. What ever I enter it opens the main
> form.
> I have posted the code in my previous post. So I don't know what's wrong
> with that code.
>
> I am working on to create other forms as well, but first I want to get
> done
> these two forms.
>
> So please guide me. I don't mind starting from scratch.
> Thanks!
>
>
>
> "Jeff Boyce" wrote:
>
>> Please post what you are trying so we can offer our ideas on why it
>> may/may
>> not work.
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Access MVP
>>
>> --
>> Disclaimer: This author may have received products and services mentioned
>> in this post. Mention and/or description of a product or service herein
>> does not constitute endorsement thereof.
>>
>> Any code or pseudocode included in this post is offered "as is", with no
>> guarantee as to suitability.
>>
>> You can thank the FTC of the USA for making this disclaimer
>> possible/necessary.
>>
>>
>> "kay" <kay(a)discussions.microsoft.com> wrote in message
>> news:8A4CC309-58F6-4B5E-A0C6-489FEA05A390(a)microsoft.com...
>> > Thanks jeff for your suggestions.
>> >
>> > currently I am working on Login form where I want user to enter
>> > username &
>> > Password.
>> > I am trying so many codes but not working.
>> > I have tblEmpID - fields are : EmpName,EmpID,EmpPassword
>> > I have tried two ways - 1. created a query to get EmpID and EmpPassword
>> > from
>> > EmpID table whrer EmpID - criteria is forms!frmLogin!txtEmpID
>> > 2. ubbound taxboxes
>> >
>> > but both ways are not working - I think i am doing some silly mistake
>> > in
>> > writing code.
>> >
>> > in my previous post i post the code which I tried earlier.
>> > Please help to write the login code so when user click on the button,
>> > it
>> > should valideate the valuse with the table and then open the main form.
>> >
>> > Thanks
>> >
>> >
>> >
>>
>>
>> .
>>