Full Version: Editing tables through a form
UtterAccess Forums > Microsoft® Access > Access Forms
Pages: 1, 2
je27
I am creating forms in Access and I finished creating the Data entry forms but now I'm trying to create a form where the user can actually edit the tables that have been populated with the entered data. I want the user to be able to enter in a box number then mark that box number with all the barcodes associated with that box number as checked out (boolean: yes)...the other thing i want the user to be able to do is to be able to select a box number and rather than checking out the whole box and all of the barcodes in that box but to check out certain barcodes in that box..and do that by entering in the barcodes...
I'm not sure if this is making any sense so I will go ahead and attach what I have done so far.
DougY
Hi,
cannot modify your database since it is A97 and I have A03.
However, I think you should have two Checkout forms: one by BoxNo and one by Barcodes.
The first form will be bound to the ITEM table and will let the user select a BoxNo and mark it OUT.
The seconf will be bound to the BARCODES tables and will let the user select a BoxNo, display the associated barcodes and let the user mark them OUT.
If you have A2K or above, let me know, I'll convert the db and create a sample.
HTH,
je27
Yes I have Access 2000 at my home computer. You can convert and I will be able to view the example.
Ounderstand the logic behind creating the two forms. My problem is actually getting that logic to work in Access. I'm not very good with it and the forms that I created were from trial and error. And I've been trying very long and hard trying to get the checkbox command on the form to actually check off the approriate record in the table.
o your saying to create two separate forms that aren't linked together one to check out the box and another form to select the box and to check out the barcodes? Or are you saying to link them together?
I want to give the user an option to check out the whole box in the item table which then automatically checks out all the barcodes in the Barcodes table pertaining to that box number. Or the other option which will allow the user to just check out specific barcodes in that box.
AND THANK YOU VERY MUCH for your help...i've had a hard time trying to get people to reply to me :(
ScottGem
First are your forms bound or unbound? If you are new to Access you really should be working with bound forms, it will be much easier. Bound forms are bound to a table (or query) and the controls on the forms are bound to fields in the table. With bound forms, entries to controls are automatically reflected in the tables.
econd, it would help to see your table structure. I'm going to assume you have a Boxes table and a Files table with the BoxBarcode as a foreign key in the Files table. If that's the case then what you should have is a mainform/subform. The main form bound to Boxes, the Subform to Files. Now if you want to checkout all the files in a box. I would have a command button on the main form with code behind it like so:
Dim strSQL As String
strSQL = "UPDATE Files SET CheckoutDate = Now(), CheckinDate = Null "
strSQL = strSQL & "WHERE BoxBarcode = '" & Me!Barcode & "';")
DoCmd.RunSQL strSQL
This will update all Files in the Box with the current date and time as the Checkout and reset the Checkin to Null
HAs an aside, I'm assuming this is a records management type application. One of the departments I work for is Records Management and I am very familiar with the design of such an app. If you want to post a stripped down version of your database I can givew you some pointers on design.
je27
I have attached a version of the database in my first post...not sure though if you can access that first post so here it is...
Thanks
ScottGem
Sorry, my bad. I didn't notice you had attached a file in the original note.
Looking at it, I don't think this is a Records Management app, but I may have some suggestions. It would help to know more about what this apps is supposed to do though. As it appears, you have an Item and you are trying to track some activity related to the Item. Can you explain in greater detail?
je27
CheckIn
This part of the app is supposed to allow the user to enter in information regarding what will be put in the box and then where that box will be stored. After selecting the type and the target class the barcode is entered for each item of the same type and target class. No box can have different target classes. So after the user scans in all the barcodes I would like the system to confirm the number of barcodes that that were scanned in for that box.
heckOut
This part of the app is supposed to allow the user to enter or select a box number from the existing box numbers in the table and in one form select an option or button to check out the whole box with all of its barcodes attached to that box number. In another form select a box number and specify particulary barcodes to be checked out by scanning the barcodes. This will then mark the boolean field yes next to all the barcodes that are checked out and fill in the checkout date field.
I hope that is not overwhelming. I really appreciate your help.
ScottGem
Actually I was looking for a broader explanation. I understood that part of it. But I'm trying to get a sense of what you are tracking, the purpose for tracking it, how its stored, etc.
et me give you an example from my experience. We track files between a remote records center and the people who use those files. Files are created and assigned a barcode. A label with the barcode is placed on the file. A file can be located in one of several places; either with an employee, in a filing drawer (or shelf) within a dept, or in a box in the archives warehouse. When a file is being sent to archives its scanned to a box and that scan is automatically recorded in our system. If a file is requested from archives, the box is retrieved and the file is scanned out to requestor.
You might want to look at barcode enabling your app.
je27
Oh my apologies...this application is only temporary and it simply is used to keep a record of tubes and plates that come and are stored (queued in a location) until they are ready to be put in the larger store. My app is only trying to keep track of what has come and where they are located and when they are checked out and into the larger store. It's supposed to be simple and I'm having complex problems. I figure your looking at it to be a more complex application but its really not and its only going to be used temporarily until the real system is up and running...
That do you mean by barcode enabling the app?
Do you think there is a way to keep my checkin form and just create the check out form as you said earlier...by creating a checkout box form (to check out all barcodes inthat box) and another form to checkout barcodes (if they want to check out some barcodes and not the whole box)?
Otried to use that sql code for the command button in the form to check out the whole box and its not working...i feel like i'm so close but so far because of my lack of knowledge...its frustruating :(
ScottGem
Ok, I understand better now, but a couple of more questions and then we can get down to work.
o the items (tubes and plates?) are received and held until they are checked out to the "larger store". Once checked out they are never checked back in? Do the check in/out dates matter? Can you define "location" more completely? Is this a box or a shelf or what? Are you looking for any reporting, if so, what?
je27
Yes they are received and placed in a box and held in a "location" which is basically one room with shelves (these shelves have numbers i.e. shelf no) . And once they are checked out they aren't checked back in. The checkin and check out dates matter for reference purposes so i'd like to have both, i forgot to put a column for checkout date in the barcodes table...i figure it doesnt need one for check in since the item table has one when you checkin the box.
The only kinds of reports that I can think of are just ones that return the boxes or barcodes that were checked in or out for a certain day.
o you think it would be silly to create another table that just holds all the barcodes that were checked out? Yeah probably...
ScottGem
Ok, Here's how I would do this. Your ItemType, TargetClass, and Shelf tables are fine. Your Barcode tables should be a Box table. And you don't need the Checkout table. The Item table would be changed to look like this:
temID (PK)
ItemTypeID (FK)
TargetClassID (FK)
Barcode (FK) (see Box table below)
DateIn
DateOut
The Box table would have just the fields:
Barcode (PK)
ShelfID (FK)
You need a Form to enter/edit Boxes. This form would have the Barcode as a text box and Shelf as a combobox. I would assume that the Shelf is selected after the box has been filled.
Next you need a form to enter each Item. On that form, you would have a combobox to select the Box its being placed in.
Finally, you need a Box/Item Mainform/Subform. You select the Box in the mainform and it displays all the Items in that box in the subform. The Subform only needs controls for ItemID and DateOut. You can add other controls if you want to display more info, but they shouldn't be editable. Now, on the main Box form you have a button like I suggested earlier. Add a Refresh of the Subform at the end of the code and it should display the updated date out.
If you don't want to checkout all the items in the box, you can just add the DateOut manually for each item being pulled out.
I think that will provide you with the functionality you are looking for, easily and simply. If you need more help with the specifics let me know. Make the changes to the tables as I suggested and upload a new copy. It would help to have a couple of boxes with a few items in each box.
je27
I think the problem with this way is that the user has to enter the same information everytime he enters a new barcode. This system will be used usually for one box at time. It is mainly on box number for many barcodes rather than many box numbers and many barcodes. Does that make sense? This is what I have done so far.
For some reason my Box form isn't adding new fields its overwriting the old ones...ahh
ScottGem
Exactly, that's why the Box is the main form and the Items the subform. Users can enter new Items in one of 2 ways. they can enter thru the Item form and select the Box from a pull down, or they can add it thru the Box/Item form, but selecting the Box and just adding a new Item in the subform.
ither way, the user is NOT entering the same info each time. Just the opposite.
je27
I'm sorry, could you look at what I have and tell me what I'm doing wrong? I attached a copy of what I did so far.
Is my Box main form supposed to be use to add and edit records? From your previous description I understood that there would be a Box form to enter the box number and select the shelf, then there would be a item or barcode form that has the boxnumber as a combobox and then i would enter the barcodes there? Then I would need a box mainform and an item subform - I thought those were used just for editing...I feel really confused now ..I thought I had it now I'm back to square one :(...thanks so much for your patience
ScottGem
Ok I rebuilt your Box1 form (the other forms are ok). I put a search combo so you can select a Box from a pull down. Or you can just cycle thru the Boxes. As you do you will see the Items subform changing. I set the subform bound to a query so it displays the Ityem Type and Target class text instead of the IDs. But this means you can't update those fields in the subform. That should be fine since the Box1 form should only be used to checkout Items.
also created an update query to checkout an entire box. I then added a command button to the form. pressing that button will set the DateOut for the entire box to the current date.
This should give you enuf to complete this on your own, but if you need more help let us know.
Hope this helps,
je27
My deepest apologies...I can't get your box1 form to work as you say...
Oalso can't get my checkin forms to logically work and input data ...it keeps overwriting the other barcodes...and plus i'm having trouble avoiding the requirement for the user to input the targetclas and the item type for each barcode...i wanted that to be a one time thing. I've really lost it! And I greatly appreciate all your help. You can leave me if you wish I dont want to cause any more headache for you .
Thanks, Joyce
ScottGem
You need to describe what you are doing better in saying the Box1 form doesn't work. It worked fine for me. I was able to select a Box number from the search and it would bring up that box record, or use the navigation buttons to select a box. In either case, the subform would display the Items associated with that box. And when I pressed the button the DateOuts would update to the current date. So you need to explain EXACTLY what you are doing and what happens when you do it.
Is for the Checkin forms. You have to open a new record before inputting more data. If you just start typing it will overwrite. As for the TargetClass and Input Type. If I understand you, these would remain the saim for a block of Items, so you don't want to have to change them each time? If that's the case, Check out Candace's WEB site In the Access 97 section is a sample titles Autofill. This would seem to be what you need.
P.S. I don't have A97 at work so I won't be able to to look at the database until this evening. But please respond with what you were doing and what was happening. I may be able to advise without looking at file.
Hope this helps,
je27
I think you will be proud of me!! I got the subform to work for me, I dont know why it wasn't working earlier...it would not show the barcodes for the box number that was selected in the subform...but it does now...I also added a couple of things like a DateOut for the Box table...I have attached what I have so far.
I am however stuck on the autofill. I downloaded that Autofill database from the webpage and I replicated what the form had on it and it's not autofilling when I go to next record in the CheckIn form...you will see what I have there..when you look at it...
but I was wondering if there was a better way to do this...like a subform that i had in my very first database...the way that CheckIn form was...?? any ideas?
Oh, and one other thing, you had mentioned having the user type in a dateout if they want to select individual barcodes rather than the whole box...could you help me figure out a way to be able to have the user just scan in (enter) a barcode after selecting a box which would then prompt that barcode entered to be checked out with a DateOut or a checkbox?
And
THANK YOU soo much for not giving up on me and for motivating me...last night i felt so lost and completely discouraged...you rock!
ScottGem
OK, You missed a few things on the Autofill. First, however, your ItemType was set up incorrectly. It wasn't setup properly as an Option Group. I fixed that. The next issue was you didn't copy the module from Candace's file. And there was one more piece, you have to set the On Current event of the form to the function in the module.
did all those things and the attached file now works. This is really one of the best ways to do it. The subform you had really was not workable.
Now as to the last part, I'm afraid I don't follow. I did make a change to the Items subform. If you click in the DateOut control, it will fill in today's date automatically. But I assume the work flow goes like this:
Items come in and are entered thru the Check in form where thay are assigned a box. When it comes time to check an item out, you use the checkout form to select individual items being pulled from the box or checkout the whole box.
One last thing, I changed the boxno on the box form to be a text box, not a combo. That form is for entering new boxes and/or assigning a box to a shelf. Selecting a box number from a pull down is circular logic.
Hope this helps,
DougY
Hi Joyce,
er your PM's here is the down and dirty forms. They are a temporary solution and should be replaced as soon ad you are done improving your db following Scott's work and guidelines (way more professional looking and better functions then mine).
HTH,
ScottGem
Just a comment here. This is an example of why its better to keep these things in the public forums. PMs should be reserved for personal discussions. By keeping things public, we can see what other people are contributing so we don't go at cross purposes.
DougY
Scott,
agree with you. That is why I posted the db in the forum and did not send it via Email to Joyce. Her PM request was simply to create the forms I advised her on in the beginning of the post.
je27
Sorry I have been missing over the weekend...I have Access 2k at home and not 97 so I wasn't able to open your attachment, Scott.
lso, regarding Doug's post I had private messaged him in the beginning when I was really nervous about completing this application on time, I thought that I could have Doug help me create a rough of the application so that I could use it to show a working demo, until I finished the quality version we were working on. I had not believed that I would get it done in time for the demo deadline, which is Wednesday. So sorry for the confusion if there was any. And thanks to the both of you.
Scott, I downloaded your attachment but the corrections you made to mine were not present. I went ahead and corrected the autofill (didn't realize there was a module) and I redid my option group using the wizard, not sure though if its right since the autofill does not work with the option buttons.
And regarding the workflow you have it right... Items come in and are entered thru the Check in form where thay are assigned a box and a shelf number. When it comes time to check an item out, you use the checkout form to select individual items being pulled from the box (selecting the individual items will be entered in using a scanner since the numbers are really small) or checkout the whole box.
I'm just wondering if there is a way to create a macro in the CheckOut from where the user scans the barcode and that barcode in the subform gets selected or highlighted then the user can just select the dateout box to check it out...? let me know what you think...
And regards to the box number being a drop down ...i thought it would make it easier for the user to remember which boxnumber they put in...but i guess there could be a way to link that text box with the text box from the checkin page so when the box form opens the last entered box number will be shown in the boxnumber text box...does that make any sense? frown.gif
thanks
J
je27
I've updated what I had attached...I am still stuck on getting the dateout to fill in after clicking it in the checkout subform...(the feature you had mentioned)
The frame in the checkIn form works now with the autofill...and I created a macro on the barcode textbox that goes to next record after LostFocus...because I wanted the user to be able to enter multiple barcodes without have to click on anything when using the scanner...but now I'm running into the problem when moving into the box form to select a box...the CheckIn form gives me an error saying that the primary key cannot contain a null field because of my macro which moves to the next record...I'm not sure how to get around that....
I'm still hoping that there will be some way to check out barcodes with the use of a scanner...any thoughts on how or if that may work?
I'm beginning to think that I've way out used the forum privileges (*shrug* :/ )...and I really appreciate all of your help.
Thanks
ScottGem
Hmm Maybe I attached the wrong version. But to get the DateOut to fill in for an individual record when you click in the field, you need do it in code. the way I did it was to use the Gotfocus event, open a code expression and enter the follwoing line:
e!DateOut = Date()
That should work.
If you want people to just type in Barcode after Barcode until the other data changes, then you have to change your Lost Focus. I don't use macros (they are too limiting), but this code should work:
CODE
If IsNull(Me!Barcode) Then
     Me!Boxno.Setfocus
Else
     DoCmd.GoToRecord , , acNewRec
End If

If they don't enter a barcode the focus will move to the Boxno control (or use whatever control you want) otherwise it will move to a new record. However, this can be dangerous if they just continue to hit enter when the other fields change.
HAs for updating records using scanner, that is defiitely possible, but it depends on the scanner. A scanner is just an input device. It captures data and stores it somewhere. You probably should contact the scanner mfg for help in integrating it into your app. But it should doable to scan a code and automatically update the DateOut control.
Finally, I wasn't trying to be critical of you for using PMs. Just pointing out how and why its better not to. The situation just gave a perfect opportunity.
Hope this helps,
je27
Good morning,
Thanks for the code...(I hate using macros too because of their limitations but I don't know how to code, yet)...however, it's not allowing me to go into the box form without giving me that "primary key cannot be null" error. I looked at the autofill.mdb and I realized that, that form produced the same error...is there anyway around it? If not, no big deal...
bout the scanner...it's already being used in applications and it functions as a keyboard. It will put the text into a text box. I guess I would have to make a lot of changes to the checkout form and make it act some how as the checkin form... or is there a way to enter in text and have it run a find command ...is that pushing it ? haha
THanks a million times,
j
ScottGem
I think you will need to rethink how you do this or how you train users. I would comment out the code from the Lost Focus event if you can't get it to work. What you might do instead, if add a New Record button and put it in the Tab order after the Barcode Control. Then the user would just have to hit enter twice and get a new record, but if they need to change the other values, then they can go to those controls first.
Is for the scanner. If you can get it so that scanning an item populates a text box, then you could take the next step by running an update query on some event associated with that box. For example:
Dim strSQL As String
strSQL = "UPDATE Items SET Checkout = Date() WHERE Barcode = '" & Me.ScannedCode & "';"
CurrentDb.Execute strSQL
The problem is where to put that. I'm not sure if the routine that populates the textbox would kick off the After Update event. So you might have to use Lost Focus or On Exit or a button. But if you can get that code to run it update just that Barcode record.
Hope this helps,
je27
Hi again,
Ok here is what I will be showing as a demo for tomorrow...I'm confident it will go smoothly but I know they will question how the scanner will be used for the CheckOut but thats ok...this will be a temporary solution.
tried to understand and create that query and the event procedure but I'm not sure how to do it...If you download my attached file I still have it in there you can see my attempt at hard coding haha...
I am willing to have the scanner just highlight the barcode that it reads on the form and then just have the user click the dateout field to check it out...but i guess the hard part is getting the scanner to actually recognize the barcode it is scanning to be the barcode on the form.
By the way I can't thank you enough for all your help.
-J
ScottGem
As I said to key to using the scanner is how it interacts. Since I don't know how that works and can't duplicate, I can't really help more than I have. I do know that my code will work and you don't have to have the Checkout form open for it to work. The only question in my mind is how to kick off the code.
If I understand you, when you scan an item, the barcode appears in a text box somewhere. Once it appears in that textbox you can then use that textbox to run the Update query by concatenating the contents of the textbox into the Update query. I suspect there is some code somewhere that takes the scanned code and puts it in that text box. The best place to put the update query is at the end of that code.
The next best place would be in the After Update event of that text box, IF populating the textbox kicks off that event. If it doesn't then the next best would be in a command button on the form.
je27
Hey...it went well...but they did have a few requests...the first was to have the barcodes that they entered in the box to show as they enetered them... I did that but its not letting me scroll down the subform to see all the barcodes because of the event procedure that on Lost Focus..i tried to put that event procedure on other commands but it still doesnt work...any ideas...you can check it out in the attachment..
heir second request..I'm not so sure how to do...they want the box no on the box form to autofill from the box no on the check in form so they dont have to type in the box no again...??
Otherwise, I still have to wait and see how this scanner business works for the Check out form..did u see the query that I wrote for it...its not written properly i know...i'm not really sure what part of your code needs to be changed....ah nevermind haha
ScottGem
On the first request. It works except if you leave the barcode blank. You can't do that.
On the second request, I think it works the way you want now.
On the scanner, the query is fine, the problem, as I said is how to kick it off. and that I can't tell you without knowing exactly how it gets from the scanner to a textbox.
je27
Good Morning,
Regarding the second request, where the user wanted the box from the checkin form to be automatically filled in on the BoxNo textbox on the Box form...it works but only for boxes that have already been assigned a shelf number (numbers already in the Box table) ...i just wanted it to concatenate/copy (if access does that) the box number on the checkin form to be the box number on the Box form...i have been doing a search and i see a lot of information about combining text but not copying from one form to another...
Thanks....j
ScottGem
The way I set it up, when they press the Assign Shelf button, the Box form opens and the record for that box number is displayed. Whether the box has been assigned to a shelf or not, shouldn't matter. On the Checkin form, they should NOT be able to select a box that hasn't been created in the Box table already. So the scenario where the box # doesn't exists shouldn't happen. If you want to allow them to enter a box number that didn't previously exists on the Checkin form, then use the NotInList event and just append a record to the Box table. I'm sure you can find some threads here (by searching on NotInList) that deal with doing that.
Hope this helps,
je27
ok ...i see why it works the way it does....and i've been completely misconstruing the path this application is supposed to take.
I have been thinking that the check in form is first than the box form...and that they select the box number first in the checkin form...and the box form is just used to assign the box number that they had entered (in the check in form) a shelf id....but from my understanding the box table should hold the box number first and the shelf id before the checkin table holds the box number?
ScottGem
Yes and no. They can't put items into a box unless the box already exists. So they can't assign barcodes to a box unless it has been entered into the box table. However, a box may not be assigned to a shelf until the box is full. So its possible for the box record to be created without a shelf assignment. The shelf assignment may be done later.
je27
ok...do you think it would cause us problems or not be done properly if I changed that exception...and just made it so that the user enters the box number from the check in and puts the barcodes in then assigns it a shelf number from the box form which is really what the flow is now...but the box wont be in the box table just the checkin (Item) table.....and then when they enter the shelf id then it will go into the table...( i know i'm repeating everything you already know)
I guess I just wanted to know if I could still concatenate the box number from the checkin form to the box form...
ScottGem
If you want to APPEND (not Concatenate), a box number by entering it on the Checkin form, you can do that and I don't think it will affect the work flow. What you will need to do is use the NotInList event of the BoxNo combo on the Checkin form. In that event, you will append a record to the Box table and requery the combobox. Like I said, if you search on that event, you will find code to do that.
But since the Box table is a separate table you will need to do that.
je27
I just have one other question about the notinlist...The boxno on the checkin form is a textbox and I would like it to be a text box because I am making that form become the first time the boxno is entered into the database....the boxno on the box form is a textbox as well...i can make that a combo but will that be necessary or useful in accomplishing the task of reading what the user had last entered in the checkin form? ...is there a way to just copy that text and put it in the box forms text? without having to go deeper into the tables? like superficially copy the text ...?
ScottGem
I think you are playing with fire here. The problem you have is that you have two tables that need to be related (Boxes and Items). BoxNo is a Foreign Key in Items. Wherever you have a Foreign key you shouldn't have a user type in that value. It should always be selected from a list so that your joins are sure to work. Otherwise you can have orphan records.
don't see a problem in using the NotInList event to add a record to the Box table if the user types in a value. Its not the way I prefer to work, but its a doable process. But only if you make sure that you append a record to the Box table when you do it. The NotInList event is perfect for that. If you don't use a combobox then you will need to put in code that will test the Box number entered, warn the user that its not in the Box table, give them the opportunity to add it to the box table, then add it if they choose to or wipe it out and allow them to input a different box number.
You have to use some method to ensuyre the Box and items tables are in sync and your records aren't orphans.
je27
scott...its not working...this is what I have..i'm not sure what to put in the notinlist...the help in access is not very helpful..and i did a search and i found something about opening another form and entering the new data there which is not what i want...
lso my append query that i created is not appending the boxnumbers...
Jack Cowley
As usual Scott is doing an outstanding job of assisting you so I do NOT want to step on his toes or take anything away from all the excellent help he has given you. Having said that I am going to suggest you look at this article and at the first method in particular as way of doing what Scott suggested with the Not In List event.
Scott - You get extra bonus points for all you do for all the members. When you reach 1 billion points you will get something free...hopefully...
Jack
ScottGem
My thanks to Jack. That's one of my shortcomings, I just don't have all those links at my fingertips frown.gif. The Method 1 in the article Jack pointed out is what you want to do. Give that a try.
Jack Cowley
You are very kind Scott. I will see about getting the bonus points cut from a billion to half a billion as you sure are earning them! notworthy.gif
ack
je27
Yes....I can't express how much Scott has done for me and taught me through this forum...I had not anticipated someone to be so knowledgeable and so patient and so kind in sharing their knowledge with me on a forum. Scott you really honestly outdid yourself and I am very very very grateful for everything you have done and taught me... Scott's so great that he doesn't even use links and he speaks to the person on a personal level which is above and beyond!!!
ack, thanks for the link...it seems to hold the information I need...
I will let you all know how it goes!
THANKS SO VERY MUCH
Jack Cowley
You are very welcome indeed! Scott is a 'Gem', if you will excuse the play on words, and we are very pleased to have both you and he as members of this forurm. We got to be number 1 because of members like you and Scott.
Thank you for your kind words of support as that is what makes this all worthwhile!
Jack
je27
I bet I can be really frustruating ...but I dont have the northwind.mdb and I am having trouble trying to figure out taking out the parts I don't need and still having it work...this is the code i have(see attached)...and i keep getting a datatype mismatch error...
I'm thinking maybe I can just have the box form open up first and have them select a shelf before they fill the box up...but that wont make sense
Can't I just make the default value of the boxno textbox on the Box form be the value that was last entered in the boxno textbox on the Checkin Form?
je27
Ok I have figured out and decided the use the default value option that I mentioned previously. That will be sufficient. I will get back to you and let you how it all goes...especially regarding the checkout scanning issue.
ThANKs again!!!
je27
Scott, I am using the scanner now to test the application and what the scanner does is simply puts the text from the barcode in whatever field or box you have the cursor at. I put your code in at the After Update event and the first error I got the "Method or data member not found" and it highlighted the
Private Sub Barcode_AfterUpdate()
and the
ScannedCode from the '" & Me.ScannedCode & "';"
So I changed '" & Me.ScannedCode & "';" and made it '" & Me!Barcode & "';"
and then I got this error
Run-time error '3061'
Too few parameters. Expected 1.
and when I select the Debug option it highlights
CurrentDb.Execute strSQL
Any idea what my problem could be? Did I change the Code in the beginning wrong in the first place?
I hope your still available to address my problems that seem to be neverending.... sorry
Joyce
I have attached my database.
ScottGem
Hi Joyce,
OK, so what happens is you put the cursor in a control. You then scan the barcode and the value appears in the control. Does the code kick off at that point or after you exit the control?
I'm not sure what is wrong with your code. Reviewing the thread, if the control you are inputting the barcode too is named Barcode, then your change seems correct. Did you try stepping try the code to see what values are returned? The only thing I can think of is its not picking up a value from Me!Barcode.
Thinking this thru some more. I think you don't want to scan to that Barcode control. I think you want an UNBOUND ScannedCode control. And then have the Update query run in the On Change even of that control.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.