Tearing Hair Out - Data Entry Forms/Subforms

epicmove

Ben
Local time
Today, 05:37
Joined
Apr 21, 2006
Messages
59
Hi Guys,

The asset managment system I have been developing is due to go live next week and I am really struggling with the data entry and search forms.

I have attached a picture of the main form (and outlined each subform) to give you an idea of my project.
The attached form is actually a Main Equipment Type Detail form with a child subform AssetMain which has a number of child subforms i.e. Asset Details, Purchase Details etc.

When a user clicks to add a new asset a popup form asks them to select an equipment type i.e. PC. When they click it opens the attached form. Their selection filters the equipment type detail values in the combo i.e. Laptop, Tower, Server etc.
When a value is then selected in the combo you can then add an asset for that equipment type detail. (One Equip Type > Many Equip Type Detail > Many Assets)

1st Problem)
I have set the Asset Main subform to allow additions only. When the whole form opens, the Equipment Type combo (at the top) does not display a value but does actually contain the first value.
How do I force my user's to select a value in the combo before it actually filters the child subform?

2nd Problem) The Asset Main Subform (filtered by selected Equip Type) should only be used for data entry. I set the data entry property of the form to True but when the value in the Equip type combo changes, it displays all the relating records in the subform. My only solution so far is to stick

Code:
Subform.DataEntry = True
in the Equip Type combo's after update event. However, this doesnt look to good as it flashes up with the data and then displays a blank record.
Any ideas?

3rd problem) Due to the fact that I am using a number of subforms, my tab order is such that values are entered for the main form (i.e. ID, Condition) then subforms (i.e. manufacturer) then back to the main form (i.e. allocated to). This means that:
a) I am having problems validating the record beforeinsert as I have had to change the required property to "no"
b) Once the user has tabbed through all the forms what is the best way to go to a new record? Alternatively if I add a new record button I need to check that the necessary fields have been filled in (on all of the forms/subforms).

and finally the 4th)
I have a search form that queries the assets. The search results are displayed in a list box. When you dblclick the list box I need to show the asset details.
Question: Can I use the above form to do this? My only problem is that I need to open the AssetMain form which is a sub form in the above. If I try and use the existing form it will not open as many of the controls refer to the form as a subform. Do you think I need to create a separate form for showing the data to entering it?

Would really appreciate some help (not that you havent heard that before :) )
My head is going to pop in a minute!!!

Thanks
Ben
 

Attachments

  • mainform.GIF
    mainform.GIF
    93.3 KB · Views: 270
I am not exacty sure what the problem is, but it seemed similar to my situation. I made my subform hidden, and only made it appear when the criteria was met in the main form (like forcing a selection). On making the subform visible, disable the fields on the main form that way it can't be changed.

Hope it is worh it?
 
Ok I have an idea for the first problem, im not a genius with Access VB like a lot of people on here but, what about this:

You could change the OnOpen Event for the form to lock all the records on the form and then set the focus to the equipment type.

Then create an event so that AfterUpdate it unlocks the records.

e.g.

Option Compare Database

Private Sub Form_Open(Cancel As Integer)

txtAssetType.Locked = True
txtCondition.Locked = True
(Do this for each record)


Me.txtEquipmentType.SetFocus

(this sets the focus to the EquipmentType box)

End Sub

Private Sub txtEquipmentType_AfterUpdate()

txtName.Locked = False
txtSecondname.Locked = False
(do this for all your records)

End Sub


The VB would look something like that, err are you ok with VB?
 
why is asset main a subform

asset main should be your main form

----------
this is the main record, surely

everything else (eg asset class, depreciation method, cost etc) is an attribute of the asset.

have all the main details on the asset form, and make combo boxes/list boxes etc to control the asset.

you should not pick the asset class first, then try to deal with the asset. instead pick the asset, and allocate it to an asset class. from there you can expand this to enable entry of more asset classes if required at trhe time of entering the asset.

does this make sense?
 
FOLLOW UP: My problem had to do with the function I used to change the sourceobject for the subform. The function that made this change ended with a requery instruction for the subform.

The form was opening in data entry mode, but the requery instruction made all records to become accessible.
________
Dodge La Femme History
 
Last edited:

Users who are viewing this thread

Back
Top Bottom