+ Reply to Thread
Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 36

Thread: Chooser Form

  1. #11
    Barn Newbie rivergum23 is an unknown quantity at this point rivergum23's Avatar
    Join Date
    Feb 2009
    Posts
    31
    Rep Power
    3

    Quote Originally Posted by sbenj69 View Post
    I've never used a scanner before, but from what I know, it's like entering in a group of characters and hitting enter, right? So instead of the button to transfer, you could put an unbound textbox, that does the same thing after update. It's been awhile since I've made or even looked at this program, and I can't really right now, as I'm at work, and tonight I have to fix a computer for a friend. So, I'm going by memory, but you should be able to do this with an unbound textbox with changing very little.
    sjben69,
    Had a good dip at trying to add this text box over the last day or two, but I'm not getting anywhere. My biggest problem is that I don't understand the VB code that takes in this case the skills from one column to the other. If you could help that would be GREAT!!

    Cheers,

  2. #12
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    bear with me river..... I've been extremely busy at work, and home has been crazy. I have looked at the chooser form briefly again, and I'll probably be doing if then statements on dcounts. First dcount will be on the tblskills table, if it isn't there (count <1)then open a form to add the skill. Second dcount will be on tblEmployeeSkills if count <1 then add it. Again, all of this will be on an afterupdate of an unbound textbox.
    Join our Folding team: DeveloperBarn Folding
    -----------------------------------
    Folding Stats - Stanford University
    Folding Stats - Extreme Over-Clocking
    Folding Stats - Kakao Stats
    Folding Stats - Xtreme CPU

    -----------------------------------

  3. #13
    Barn Newbie rivergum23 is an unknown quantity at this point rivergum23's Avatar
    Join Date
    Feb 2009
    Posts
    31
    Rep Power
    3

    RE: Chooser Form

    sjben,
    Wow, anyway help would be greatly GREATLY appreciated!!

    Thanks Again,
    Brett.

  4. #14
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    Ok, I should be able to get to this tonight after work (I'm at work now) So, I will be able to start on this in about 8 hours. I should have something up within 12 hours from now.
    Join our Folding team: DeveloperBarn Folding
    -----------------------------------
    Folding Stats - Stanford University
    Folding Stats - Extreme Over-Clocking
    Folding Stats - Kakao Stats
    Folding Stats - Xtreme CPU

    -----------------------------------

  5. #15
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    Heh, finished with 8 minutes to spare

    ok, ok, so I put 1/2 hour into this.... but 1/2 hour from me is hard to come by these days.....

    Ok, so all I did was put an unbound textbox, and then this code behind it:
    Code:
    Private Sub scanned_AfterUpdate()
    Dim skillscount As Integer
    Dim empsklscount As Integer
    Dim EmptySkilldescr As String
    Dim MySql1 As String
    Dim MySql2 As String
    Dim MySql3 As String
    
    
    'Error check for too small of entry
    If Len(Me.scanned) < 2 Then
    MsgBox ("No Valid Code Entered")
    Me.scanned = ""
    Me.scanned.SetFocus
    Exit Sub
    End If
    
    
    'count skills in tblskills and tblEmployeeSkills
    skillscount = DCount("[skilldescription]", "tblskills", "[skillid]='" & Me.scanned & "'")
    empsklscount = DCount("[employeeidfk]", "tblEmployeeSkills", "[employeeskill]='" & Me.scanned & "' And [employeeidfk]='" & Me.EmployeeID & "'")
    
    'update tables as necessary
    If skillscount < 1 Then
    EmptySkilldescr = InputBox("Item not in listed skills. Please enter brief description")
    MySql1 = "Insert Into tblskills (SkillID, SkillDescription) Values ('" & Forms!formmain.scanned & "','" & EmptySkilldescr & "');"
    MySql2 = "Insert Into tblEmployeeSkills (EmployeeIDFK, EmployeeSkill) Values ('" & Forms!formmain.EmployeeID & "','" & Me.scanned & "');"
    DoCmd.SetWarnings False
    DoCmd.RunSQL MySql1
    DoCmd.RunSQL MySql2
    DoCmd.SetWarnings True
    
    ElseIf empsklscount < 1 Then
    
    MySql2 = "Insert Into tblEmployeeSkills (EmployeeIDFK, EmployeeSkill) Values ('" & Forms!formmain.EmployeeID & "','" & Me.scanned & "');"
    DoCmd.SetWarnings False
    DoCmd.RunSQL MySql2
    DoCmd.SetWarnings True
    
    End If
    
    'delete if necessary
    If empsklscount > 0 Then
    MySql3 = "Delete * From tblEmployeeSkills Where [EmployeeIDFK] = '" & Forms!formmain.EmployeeID & "' and [EmployeeSkill] = '" & Me.scanned & "'"
    DoCmd.SetWarnings False
    DoCmd.RunSQL MySql3
    DoCmd.SetWarnings True
    End If
    
    'requery lists, delete value from textbox, and set focus to textbox
    Me.List6.Requery
    Me.List8.Requery
    Me.scanned = ""
    Me.scanned.SetFocus
    End Sub
    
    It looks worse than it is.

    Step 1, after update of the textbox check the length.... if it's less than 2 characters long, then it does nothing and blanks out the textbox.

    Step 2, I did a dcount on tblSkills (where the master set of skills are stored) and tblEmployeeSkills. If the count is less than 1 in either, that means the skill is not there and needs to be entered.

    If it isn't in the master table (tblSkills) then it asks for a brief description, and adds it to both tables.

    If it isn't in the employee skills table (tblEmployeeSkills) but is in tblSkills then it adds it to tblEmployeeSkills.

    If the skill is in the skills list (tblSkills) and it is in the employee skills table (tblEmployeeSkills), then it removes it from the list of skills the employee has.

    Finally it requeries everything and sets focus back onto the textbox for scanning and erases the previous entry.

    This is only a rough draft and not fully tested. For one, I don't have a scanner. Anyhow, without further adieu, here is the updated version.

    Now, you have a rough draft for what you need to do. You can refine the database to your needs. In the near future, I might even make this database include prices. Given the base program, you can do pretty much anything you have to. Keep me informed if you need added functionality. I'll be happy to do so, but give me time. I'm in the middle of redoing our company's web site, which consists of 10+ pages......

    Edit - clean up code box a bit.
    Attached Files
    Last edited by sbenj69; February 27th, 2009 at 02:18 AM.
    Join our Folding team: DeveloperBarn Folding
    -----------------------------------
    Folding Stats - Stanford University
    Folding Stats - Extreme Over-Clocking
    Folding Stats - Kakao Stats
    Folding Stats - Xtreme CPU

    -----------------------------------

  6. #16
    Barn Newbie rivergum23 is an unknown quantity at this point rivergum23's Avatar
    Join Date
    Feb 2009
    Posts
    31
    Rep Power
    3

    RE: Chooser Form

    sbenj69,
    Thankyou very much it is perfect!! It Does everything I need it too!! I envy your programming skills.

    The only other thing I will bug you about is that I have added a command button to run an external application. I was wondering if its possible to disable or grey out the command button until the Skills Available column is empty, in my case this would mean that all products are scanned??

    Again, Thanks for your time and help!!

    Brett

  7. #17
    Lightning Master AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123's Avatar
    Join Date
    Mar 2008
    Location
    Fortress Of Solitude
    Posts
    394
    Rep Power
    7

    The most obvious thing to use here is list count,. although i don't know what it is with that function, but it seems to have issues

    Anyway,

    you won't be able to run this direct with ListName.ListCount, so add a text box to your form.

    Control Source,. =List6.ListCount ' list 6 being that in sbenjs example for skills available.

    Then Add, the following events- [Form OnCurrent],[List Box Dbl Clicks],[List Box Transfer Buttons OnClick], and [Form Navigation Buttons OnClick]

    Code:
    If Me.TextBoxName = 0 Then
    Me.CommandButton.Enabled = True
    Else
    Me.CommandButton.Enabled = False
    End If
    Me.List6.Requery
    
    End Sub
    
    If i helped you, make me famous by clicking the

  8. #18
    Barn Newbie rivergum23 is an unknown quantity at this point rivergum23's Avatar
    Join Date
    Feb 2009
    Posts
    31
    Rep Power
    3

    RE: Chooser Form

    Ok,
    Just a little too much for me... I added the textbox and have the listcount going but are unsure where the events should be with the code. I've attached the program with the command so if possible you can show me.

    thankyou also for your time and help.

    Brett
    Attached Files

  9. #19
    Lightning Master AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123 is a jewel in the rough AOG123's Avatar
    Join Date
    Mar 2008
    Location
    Fortress Of Solitude
    Posts
    394
    Rep Power
    7

    See attached,

    Thanks

    AOG
    Attached Files
    If i helped you, make me famous by clicking the

  10. #20
    Barn Newbie rivergum23 is an unknown quantity at this point rivergum23's Avatar
    Join Date
    Feb 2009
    Posts
    31
    Rep Power
    3

    RE: Chooser Form

    AOG123,

    Thanks for that... I have not had a chance to try it, but I'm sure it will work great. Thanks for your help also.

    Brett

+ Reply to Thread
Page 2 of 4 FirstFirst 1 2 3 4 LastLast

Similar Threads

  1. Time Entry Form
    By sbenj69 in forum Access Database Samples
    Replies: 5
    Last Post: May 1st, 2009, 06:48 AM
  2. Simple way to email form
    By Rebelle in forum ASP Development
    Replies: 17
    Last Post: August 14th, 2008, 05:03 PM
  3. Generic Form Handler
    By richyrich in forum .NET Development
    Replies: 3
    Last Post: July 28th, 2008, 02:34 PM
  4. filters on a form
    By javier_83 in forum Microsoft Access
    Replies: 4
    Last Post: July 28th, 2008, 02:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO