Suppressing record entry and input via dialog box

andrefrancis

andrefrancis
Local time
Today, 14:40
Joined
Mar 11, 2005
Messages
40
I have a problem that is probably very straightforward to you Access experts.

A brief description of the salient parts of my setup are given as numbered paras below.

1... I have 2 tables: Jobs and Sessions in a defined 1 to many relationship.

2... I have defined a form in parent-child format with the child (session) records displayed in single line (continuous) mode.

3... The above works as intended, ie as different jobs are selected (via combobox or bespoke navigation arrows), so the relevant session lines appear. I have removed both record selectors and default navigation buttons from both form and subform.

4... Because all but one (a simple text description) fields are auto or calculated, I do not want the user (Yes ... it's me ... but It could be someone else ... if I drop dead) to attempt to input via the form, since it causes problems for some of the calculated fields. :(

QUESTION A. How can I suppress the record entry part (bottom line) of my session one-liners subform? (The problem doesn't arise with the main job page-mode form, since the removal of the default navigation makes it impossible to add a job via the form).

QUESTION B. What code do I need to create a new session for a defined job via a simple dialog box or bespoke form which requires only two input parameters: jobname and sessiondescription. (All other fields are calculated automatically from today's date and jobname)

5... I currently perform input using the jobs table (ie selecting the relevant job), expanding the (sub)sessions table and then adding a session description ... but this is not so user-friendly!

I would appreciate any help and/or relevant comments.
 
How can I suppress the record entry part (bottom line) of my session one-liners subform?

If I understand you correctly you want to make it impossible to enter any data into the fields that are automatically calculated. If this is the case then simply set the Locked property of these fields to "Yes" and the Enabled property to "No". This will prevent anyone from being able to put a cursor in the field or enter any data (also prevents them from being "tabbed" into).

What code do I need to create a new session for a defined job via a simple dialog box or bespoke form which requires only two input parameters: jobname and sessiondescription.

I'm having a bit more trouble understanding what you are asking with this. Do you want to create a button that has the same effect as pressing the >* navigation button? If so, simply use this code in the On Click property of the "new record" button

Code:
DoCmd.GoToRecord , , acNewRec

If this isn't what you are asking, then please clarify (sorry, it's still early for me in New York City) and I'll try to be more helpful.

Hope this helps!
 
KeithIT, thanks for the attempt to understand my ramblings ... I am aware of the things you have mentioned.

As much as I tried, I wasn't able to describe clearly what I need. I'll try again ...

... forget the form/subform structure for now.

I currently have a (sub)form that displays records using a tabular layout. This structure is ideal for my browsing needs. However, because all the fields (except one - a simple text field) are automatic or calculated, and I must admit fairly convoluted, it needs some macro form action before any new record has the chance to display properly - it certainly doesn't if I try using my form to input (the text field). Thus I need to disable the ability to create a (problematic) record in this environment. Is this possible?

The way I currently input is via tables. I simply key in descriptive text to the text field (mentioned above) ... and then afterwards when I call up my form, all the fields have been calculated and the new record is displayed perfectly. However, using tables like this is not user-friendly - I would much prefer to press a button labelled 'create new session', which would simply ask for the job name and some descriptive text and then go away and create the record - without the user (essentially me) needing to see tables or forms. This was my second question in the previous post.

This may sound a strange set-up, but in fact, all I am doing is using the text input (together with a job name) to trigger the creation of a 'documentation session' record, which is stamped with today's date and then uses info from the parent form to create automatic hyperlinks to Word and Excel documents.

I hope this describes my problem(s) a little more clearly.

Any further attempts to help will be greatly appreciated.

PS I have just seen how to attach a picture to my post :eek: , so please observe my actual form/subform structure
 
oops ... It seems I didn't succeed in attaching my picture.

Trying again ...
 

Attachments

  • Form_Subform.jpg
    Form_Subform.jpg
    75.9 KB · Views: 137

Users who are viewing this thread

Back
Top Bottom