473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Datasheet view questions

I haven't developed applications in 2 years (have been doing straight
SQL Server work) and I am new to developing in Access. I know that
using the datasheet view of a form is not usually the preferred method
of end-user access, but it seems appropriate for one of the tables I'm
using.

The table contains two columns, MonthStartDate and ClinicDays. The
user needs to enter the numbers of days the clinic will be open for
each month. Generally, they enter 3 months at a time (for a quarter),
but they are allowed to enter as many as 12 months in advance. This
number of days is used later in the process for calculations.

1. When they open the form (in datasheet view), I'd like to position
them at the next month they need to enter. Can anyone tell me how to
do this?

2. They should only be allowed to enter days for future months, not
past. How can I make some of the records read-only?

3. And how can I make the MonthStartDate column read-only?

Thanks for helping!
Jana

Nov 13 '05 #1
1 2085
Suggest you use a continuous form rather than a datasheet

Set the Allow Additions and Allow deletions to "No"
Set MonthStartDate Locked to True

Add the following code

Private Sub ClinicDays_BeforeUpdate(Cancel As Integer)

' Stops alteration of ClinicDays on any day before today

If MonthStartdate < Date Then
MsgBox "You cant change old data", vbCritical
Cancel = True
SendKeys "{ESC}"
End If

End Sub

Private Sub Form_Open(Cancel As Integer)
' Goes to the first record where ClinicDays = 0

DoCmd.GoToControl "ClinicDays"
DoCmd.FindRecord 0

End Sub

<js***@virginia.edu> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I haven't developed applications in 2 years (have been doing straight
SQL Server work) and I am new to developing in Access. I know that
using the datasheet view of a form is not usually the preferred method
of end-user access, but it seems appropriate for one of the tables I'm
using.

The table contains two columns, MonthStartDate and ClinicDays. The
user needs to enter the numbers of days the clinic will be open for
each month. Generally, they enter 3 months at a time (for a quarter),
but they are allowed to enter as many as 12 months in advance. This
number of days is used later in the process for calculations.

1. When they open the form (in datasheet view), I'd like to position
them at the next month they need to enter. Can anyone tell me how to
do this?

2. They should only be allowed to enter days for future months, not
past. How can I make some of the records read-only?

3. And how can I make the MonthStartDate column read-only?

Thanks for helping!
Jana

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Keith Wilby | last post by:
I have a form which allows both form and datasheet views. My question is, is it possible to control the field (column) names in datasheet view? What happens at the moment is that the name is...
3
by: Kent Eilers | last post by:
I want to follow naming conventions for my controls - i usually prefix combo boxes with "cbo". When a form is in datasheet view however i do not want the user to see the 'cbo' prefix in front of...
2
by: Georges Heinesch | last post by:
Hi: I have a tables in relationship to each other. When I open the main table (table 1), I see a "+" at the very left of every record. Clicking on the "+" expands the data of the linked table...
13
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any...
1
by: Yuki | last post by:
I am trying to find out if I can have a specific record that has been selected in a list box be opened in datasheet view. I can't seem to find where this can happen or what I need to use to make...
1
by: sasan3 | last post by:
when I set visible=false, then entry is not visible in form view, but still shows up in datasheet view. How do I make a field not to show based on some condition in datasheet view? Tx.
5
by: Bill | last post by:
This database has no forms. I am viewing an Access table in datasheet view. I'd like to execute a macro to execute a function (using "runcode"). In the function, I'll reading data from the record...
3
by: Bface | last post by:
Hello, I tried looking through some of the postings to see if anyone asked these questions before but I didn’t find any. I have 3 questions and I hope someone can help me out. I will write post...
2
by: Alan Forsyth | last post by:
That rather long subject says it. In Access97 running on XP - I want to display a Maximized size Form01, then open a Restore size Datasheet View Form02 on top of the first Form. PopUp won't give...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.