06. juli 2001 - 11:35Der er
10 kommentarer og 1 løsning
Bevar værdi
Her er sikkert nogle lette point:
En ordredatabase vil typisk indeholde mange poster fordelt på få sælgere. Jeg vil derfor gerne have et lille afkrydsningsfelt i formularen som brugeren kan afkrydse så den næste nye post automatisk har sælgerens navn forudfyldt.
The hidden field is just to hold the last enetered sales rep. This gets updated every time an after update event is triggered, it could also be blank if your dB allowes it!
Then the before update event checks to see if you want to use the last sales rep. name, if so move it to the field and this is the table field and not the text field.
I can follow your reasoning terry, and it seems you pretty much understand what I want to do. And there is no problem in writing to the hidden field, that part works a charm. But now I have to get the syntax for the second leg right.
Basically, a user types in a name in the namefield, checks a box by the name, and the next record created will have the same name in the namefield. So it\'s a new, blank record except for one field carried over from the previous record.
I\'ve tried the If ... then option, but that only gives me a runtime error. A strategically inserted msgbox confirms that the value contained in the hidden field is the correct one, but it won\'t allow me to create a new record with it.
Does that make slightly more sense? Figured I\'d give my English a go seeing as that seems to be your preferred style :^)
I have another suggestion. The first idea had its flaws! I suggest that you have a combo box containing all sales reps. names and also a check box. Then if the user selects a sales rep. and also checks the combo, then all NEW records will get this name.
In the Before Insert event place code similar to this.
If cbChecked = True then me.sælgere = Me.cboAllSalesReps end if
Change the field name accordingly
I would also set the tab stop field for the sales rep to NO, as this gets entered automatically.
Thanks for the extra points, hope it works, if not then get back to me!
terry
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.