MS Access 2007 Login & TempVars

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Following on from the last video let's delve into this Northwind login form a bit more I've added a command button here and we're in design view you now and I've added a command button here and if we go through the to the code I've gone up in the ..... pressed code selection button up in the top right hand corner ... this is the code for the command button I want to test this tempvars and and see what we're getting back so.... copy this part out of here paste it into the code there and lets do a message box now I like to include some text like that " >>> " you can do what you like... the whole idea is so that the message box actually return something then you know .... you're getting something back something expected makes it easier to identify if you get something unexpected. Now use the ampersand and then we'll get the contents home the tempvars and I'm not 100 percent sure how this is done but I would guess it would be I wonder if it's in a square bracket current user ID I'm gonna run the debug compile Well... it didn't throw any Errors! I'm saving this code and ... I'll return to form view and show you from there. Now let's press the button and see what happens... we get a message box.. notice I've got the three arrows I put in myself and this is what it's returned square brackets combo current employee OK... So looking at the code its returned this string here not what we wanted we wanted the contents of the combo box OK... So the conversion which was down here hasn't done a complete conversion what I think we need to do and change this to me dot me refers to the form we're on so we are in this form, so it always refers to this form you noticed it actually displayed that so looks very likely it's going to work compile again and we'll run the right Tempvars can only store data they cannot store objects the assumptions wrong here somewhere I'm not trying to store the object but .... in older versions... See .. actually it's showing you now.... the value of the combo box is equal to Two (2) you notice that nice little window underneath So actually i'll move the screen display over a bit... see.. that's what's happened the codes still running and I'll show you... run reset It'll stop the code running... or we could continue I'm gonna reset that's reset it.. so now this is probably me older versions of access would let you get away with so that's probably wants the "Value" let's try that... I'm pressing the save button again then I'm gonna press the debug seems okay. So I'll get the form going again and we'll see what happens right Ah!!! now we've got my text which was SPACE three brackets, 3 Angle brackets and a space and a two (2) and thats the value of Andrew in this Windows So if we take "Jan" lets see what we get there thats 3 OK and the value Micheal Nappier 6 just do one more because wheres this seven coming from and I'll show you that next, Thats an interesting feature a comboboxes which is very handy so now we've got it working properly we just change the other code because the other code was in the square brackets as well the .... I'll just show you quick this code screen active control so I'm gonna un bracket that.. I'm not 100 percent sure that this is going work either .... maybe it should stay in brackets ... I don't know... whip em out lets see what happens "Debug" "Compile" that worked so I've done the debug compile at the top of the screen where you can't see are just try the form again see what happens. Press go again,, We're getting a value back there. Ah!... now We got an error debug again and now we've got the Error in the other code. I'll remove the square brackets in there but it doesn't like that.. so I'm going to have a fiddle about with that and get that working but this Video is coming to an end It's getting too long Cheers!!!
Info
Channel: Nifty Access - Microsoft
Views: 15,853
Rating: 4.4285712 out of 5
Keywords: TempVar, TempVars, Macro, VBA, Access 2007, Northwind 2007
Id: XEKOO247SxA
Channel Id: undefined
Length: 6min 47sec (407 seconds)
Published: Wed Aug 19 2009
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.