UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
6 Pages V « < 4 5 6  (Go to first unread post)
   Reply to this topicStart new topic
> Ms Outlook Style Calendar For Access Projects, Access 2003    
 
   
Peter Hibbs
post Oct 11 2018, 10:03 AM
Post#101


UtterAccess VIP
Posts: 1,589
Joined: 17-June 10
From: Dorset. UK.


Hi DBQueen,

Thanks very much.

Peter.
Go to the top of the page
 
whybrow23
post Oct 13 2018, 04:02 AM
Post#102



Posts: 35
Joined: 17-July 18



Hi Peter

Thanks for your feedback.

So I was thinking I could make a copy of the frmCalendarMain and calling it frmCalendarUser, but when I open it a window pops up with the attached.

Attached File  Capture.JPG ( 14.68K )Number of downloads: 0


I've tried added the new form frmCalendarUser to the code and the queries but with no luck. the pop still appears. any idea what I might be missing?

My thinking is I could then use this new form as the read only one for the users.

Many thanks
Marc
Go to the top of the page
 
isladogs
post Oct 13 2018, 05:39 AM
Post#103



Posts: 583
Joined: 4-June 18
From: Somerset, UK


Hi Marc

Why are you duplicating the form? Your original idea in post #90 is the logical way to ensure a form is read only for some users and editable for admins.
Go to the top of the page
 
whybrow23
post Oct 13 2018, 06:56 AM
Post#104



Posts: 35
Joined: 17-July 18



Hi isladogs

Because I not sure on how to do it.

But after writing my last post, I'm thinking I could make a copy of the database, 1 for Admin and 1 for Users and then spilting the DB with both of the db pointing towards the same tables.

But if you know of a way I could use the password way and incorporte it with the db, help would be appreciated?

many thanks
Marc
Go to the top of the page
 
isladogs
post Oct 13 2018, 08:34 AM
Post#105



Posts: 583
Joined: 4-June 18
From: Somerset, UK


You could do that but once again I wouldn't do so as it means duplicating any changes that are made in the future

There are lots of examples of user login forms available online including the the code archive at this forum
Have a look at the links in this thread as a starting point: Login forms

However if the form should be read only except for you as a developer you MAY have a simpler solution
It depends on checking the user name and workstation name

Add code similar to this in the Form_Load event of your calendar form

CODE
Private Sub Form_Load()

Dim ctrl As Control

'lock controls by default
For Each ctrl In Me.Controls
      If TypeOf ctrl Is TextBox Then
       ctrl.Locked = True
      End If
    Next

'alter the next line as appropriate
If Environ("UserName") = "YourUserName" And Environ("ComputerName") = "YourWorkstationName" Then

    For Each ctrl In Me.Controls
      If TypeOf ctrl Is TextBox Then
       ctrl.Locked = False
      End If
    Next
End If

End Sub


NOTE:
1. Its not a flexible solution in that if you swop PCs, the form will also be locked for you
The code above only locks textboxes. It will need modifying if you have combos/listboxes etc

2. You can also lock the form by default by setting Allow Edits/ Allow Additions / Allow Deletions to No in the form properties

3. Another approach uses the tag property to lock controls. Have a look at this example app: SetControls - you may be able to adapt that for your needs

Good luck
This post has been edited by isladogs: Oct 13 2018, 08:57 AM
Go to the top of the page
 
whybrow23
post Oct 13 2018, 08:48 AM
Post#106



Posts: 35
Joined: 17-July 18



thank you

I'll have a look and read

Marc
Go to the top of the page
 
whybrow23
post Oct 14 2018, 08:46 AM
Post#107



Posts: 35
Joined: 17-July 18



Hi Peter

Think I've found a couple of bugs

If I click the Unbound field for the Year at the top of the Main form See attached

Attached File  YearBug.jpg ( 15.41K )Number of downloads: 7


I get the following Run-time error '2465'
Can't find the field 'CalBtn' referred to in your expression.

and the other, when I go to enter in a new appointment and I go to enter a date, I click on the calendar date control icon and I get the follow error.

An expression in argument 2 has an invaliud value

Can you help please?

Thanks
Marc
Go to the top of the page
 
Peter Hibbs
post Oct 14 2018, 09:53 AM
Post#108


UtterAccess VIP
Posts: 1,589
Joined: 17-June 10
From: Dorset. UK.


Hi Marc,

I get the following Run-time error '2465'
Can't find the field 'CalBtn' referred to in your expression.
Did you delete (or change the name of) the CalBtn icon image in the Header section of the form?

and the other, when I go to enter in a new appointment and I go to enter a date, I click on the calendar date control icon and I get the follow error.
An expression in argument 2 has an invalid value
I don't get any errors for this, did you make any changes to this form (maybe the same icon control as above)?

Peter.
Go to the top of the page
 
whybrow23
post Oct 14 2018, 10:31 AM
Post#109



Posts: 35
Joined: 17-July 18



Thanks Peter, yes I didn't mean to but I deleted the CalBtn date icon.

I still get the 2nd error - An expression in argument 2 has an invalid value - when I click on that icon or when I try to pick a date on the appointment form.

It also happens on the last update DB you done for me and thats without me making any changes

Marc
Go to the top of the page
 
Peter Hibbs
post Oct 14 2018, 03:12 PM
Post#110


UtterAccess VIP
Posts: 1,589
Joined: 17-June 10
From: Dorset. UK.


Hi Marc,

I have no idea why the second error happens but it sounds like a problem with the pop-up date picker which I added to this application. I suggest you remove that option from the date fields on the frmCalendarAppt form and see if it works with the Access pop-up calendar. Just delete the contents of the On Got Focus and On Lost Focus properties of all the date type fields and also set the Show Date Picker property to 'For dates'.

If you want more info about my pop-up Date Picker Demo you can find it HERE.

Good luck,

Peter.
Go to the top of the page
 
whybrow23
post Oct 15 2018, 03:39 AM
Post#111



Posts: 35
Joined: 17-July 18



Topman Peter

That fixed it.

Sorry, another query.

Year view screen, the section Appointment Details where it displays/imports data entered, is it easy to display more data from the same table? I've added some new fields to tblAppointments and tried following your code with the new field (see below) but I get a Compile error: Expected: Line number or label or statement or end of statement.

I'm sure it's something simple

CODE
Public Sub UpdateDetails(vApptID As Long)

'Display appointment details on screen
'Entry  (vApptID) = ApptID of appointment to display

Dim rst As Recordset

    Set rst = CurrentDb.OpenRecordset("SELECT * FROM qryAppointments WHERE ApptID = " & vApptID)
    If rst.BOF = True Then Exit Sub
    Me.txtDetails = "Appointment Times: " & Format(rst!ApptStart, "Short Time") & " to " & Format(rst!ApptEnd, "Short Time") & vbCrLf _
    & "Location: " & rst!ApptLocation & vbCrLf _
    & "Notes: " & rst!ApptNotes & vbCrLf _
    & "All Day Event: " & IIf(rst!AllDayEvent = True, "Yes", "No")
    & "Contract Code: " & rst!"ApptContract Code" & vbCrLf
    
    rst.Close
    Set rst = Nothing


End Sub
Go to the top of the page
 
cheekybuddha
post Oct 15 2018, 05:18 AM
Post#112


UtterAccess VIP
Posts: 10,468
Joined: 6-December 03
From: Telegraph Hill


CODE
' ...
    & "All Day Event: " & IIf(rst!AllDayEvent = True, "Yes", "No")
    & "Contract Code: " & rst!"ApptContract Code" & vbCrLf
' ...

Missing the line continuation character (and probably a new line too)
CODE
' ...
    & "All Day Event: " & IIf(rst!AllDayEvent = True, "Yes", "No") & vbCrLf _
    & "Contract Code: " & rst!"ApptContract Code" & vbCrLf
' ...


hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
Peter Hibbs
post Oct 15 2018, 05:54 AM
Post#113


UtterAccess VIP
Posts: 1,589
Joined: 17-June 10
From: Dorset. UK.


Hi Marc,

OK, try this :-

CODE
Public Sub UpdateDetails(vApptID As Long)

'Display appointment details on screen
'Entry  (vApptID) = ApptID of appointment to display

Dim rst As Recordset
    
    Me.txtDetails = ""
    Set rst = CurrentDb.OpenRecordset("SELECT * FROM qryAppointments WHERE ApptID = " & vApptID)
    If rst.BOF = True Then Exit Sub
    Me.txtDetails = "Appointment Times: " & Format(rst!ApptStart, "Short Time") & " to " & Format(rst!ApptEnd, "Short Time") & vbCrLf _
    & "Location: " & rst!ApptLocation & vbCrLf _
    & "Notes: " & rst!ApptNotes & vbCrLf _
    & "All Day Event: " & IIf(rst!AllDayEvent = True, "Yes", "No") & vbCrLf _
    & "Contract Code: " & rst![ApptContract Code]
    rst.Close
    Set rst = Nothing

End Sub

BTW, it is NOT a good idea to have spaces in a field name (which I why I had to wrap the ApptContract Code field name in square brackets) so I would suggest you change that if you can.

Peter.

Oops, I see David beat me to it!!
Go to the top of the page
 
cheekybuddha
post Oct 15 2018, 06:42 AM
Post#114


UtterAccess VIP
Posts: 10,468
Joined: 6-December 03
From: Telegraph Hill


Ahh.. but I completely missed the space in the field name! blush.gif

d

--------------------


Regards,

David Marten
Go to the top of the page
 
whybrow23
post Oct 15 2018, 07:20 AM
Post#115



Posts: 35
Joined: 17-July 18



Thanks guys, that fixed it.

thanks.gif
Go to the top of the page
 
ixxo09
post Oct 18 2018, 06:40 AM
Post#116



Posts: 7
Joined: 30-September 18



Hello everybody:

At frmCalendarAppt in Public Sub FetchAppointmentData at the line:

DoCmd.OpenForm "frmRecurrenceSelect", , , , , acDialog, vText 'select option to open single appt or series

when it opens the form, the listbox items disapear.

Any ideas to sort it out?
Go to the top of the page
 
Peter Hibbs
post Oct 18 2018, 10:32 AM
Post#117


UtterAccess VIP
Posts: 1,589
Joined: 17-June 10
From: Dorset. UK.


Hi ixxo09,

I don't see that happening here, the data in the list does not change when I click on a recurring appointment in the List box (which is when that line is executed). Did you implement the fix described in post #75? Not sure if that could cause this problem but it might.

Have you made any changes to the database that you downloaded?

Are we talking about the version in post #84 (which should have that bug fixed anyway)?

If you still get the problem perhaps you could upload it here so I can check it out.

Peter.
Go to the top of the page
 
ixxo09
post Oct 18 2018, 06:00 PM
Post#118



Posts: 7
Joined: 30-September 18



Hello Peter:

Thanks to replay.

I downloaded the application in post 84 and it does the same. Look at the attached file and then you tell me.
Attached File(s)
Attached File  items_listbox.gif ( 1.07MB )Number of downloads: 10
 
Go to the top of the page
 
ixxo09
post Oct 18 2018, 09:12 PM
Post#119



Posts: 7
Joined: 30-September 18



Hi Peter:

The easy way I sorted it out was moving the code of the listbox click event to the doble-click event.

CODE
Private Sub lstAppts_DblClick(Cancel As Integer)
    'User clicks on an appt in List box
    
    Me.chkUpdate = True                                                                     'set chkUpdate if user selects an existing appt for modification
    If Not IsNull(Me.lstAppts) Then FetchAppointmentData Me.lstAppts                        'enable input fields and fill with data from list box, etc

End Sub


Any other idea will be welcome.

Joe
Go to the top of the page
 
Peter Hibbs
post Oct 19 2018, 07:36 AM
Post#120


UtterAccess VIP
Posts: 1,589
Joined: 17-June 10
From: Dorset. UK.


Hi Joe,

OK, very odd as I don't see that behavior, I guess it must be something to do with A2016. I don't have any other suggestions so I think your fix is good and it may help someone else one day.

Peetr.
Go to the top of the page
 
6 Pages V « < 4 5 6


Custom Search
RSSSearch   Top   Lo-Fi    22nd October 2018 - 05:49 PM