Jeg har en formular med en underfomular. Én af felterne i underfomularen er obligatorisk, men Posten kan sagtens gemmes uden indhold i feltet, hvorfor ? Jeg har brug for at formularen og underformularen ikke kan gemmes unden indhold i flere felter, blandt andet et vigtigt felt i underformularen.
Jeg har sat det til obligatorisk, men ingen forskel.
Nope, doesn't work. I've searched high and low, from what I've read it's not possible. I've set the required and default value as you said, no luck. It seems, that, since it's a subform, Access saves the post before I even enter the subform. And thus, I can exit the post without data in the subform.
A field which is "obligatorisk" is only valid when you create/change a record in that table. If you have a main form and add a record there it doesnt mean that you have automatically added a record to the sub form table.
Is it possible to see the database? ekspertenATsanthell.dk
Can't show you the db, sorry. Perhaps I could do a little cheat. Could I, when a new post is created, enter invalid data ind the subform, then when the user wants to create a new post, the invalid data creates an event ? get my point ?
To decide on a solution all depends on what the applications is supposed to do. For example should it be allowed to add a record in the main form without any related records in the sub form?
If there are no records in the sub form should the user be asked if they have forgotten to to add and if so go back and add one or more. Or should they be allowed to procede without adding records in the sub form and at the same time delete the record in the main form. As you can see there are a number of ways to do things and in the end it is up to you.
You can test if there are any records in the sub form with code similar to this
If Me.SubFormObject.Form.Recordset.RecordCount = 0 Then ....
NOTE: SubFormObject is the name of the object containing the sub form NOT the name of the sub form. In most cases they are named the same but they need not be.
it could be Form_Rabatudbetaling but it doesnt need to be.
In design view click in the very edge of the sub form then righ click and choose properties. On the top of the properties window you should see Subform/Subreport and the name. If you see Form then you havent selected the Subform/Subreport. Once you have selected the Subform/Subreport then you need to replace SubFormObject with the name.
The name of the Subform/Subreport ane the actual from are very likely the same but as I said they do not need to be.
I dont often place questions so not too sure how it works but I think you need to select a user from the list of those who have placed an answer then accept.
Other users have compained about it not working so good, so maybe you should contact admin.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.