Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-24-2018, 01:53 PM   #1
rdw456
Novice
 
Join Date: Jul 2012
Location: Nova Scotia, Canada
Posts: 43
Thanks: 7
Thanked 0 Times in 0 Posts
rdw456 is on a distinguished road
Combobox brain teaser

Hi all merry Christmas to you all

I have a combobox on a main form called Employee it uses a table called

tblEmployee
Employee_ID auto number
First name Text
Last name Text
Phone number Text
Inactive yes/no

On the form when you select a name it places in the field Emplee_ID on the main table all works well until we had staff turnover. I then changed the combo box query criteria to filter just the active staff which worked fine until I went back to previous records of the person who had left and found the field blank when I take the filter off they are there. The other strange thing is in the main table the employee_ID field which is of the number type has been accepting text and because it has a lot of record and it won't let me. The main table also has a auto number field Trans_ID that is used as a primary key. I have tried many things in the properties of the combobox but dont seem to be able to arrive a solution.

Any idea's would be welome

Thanks Bob Wild

rdw456 is offline   Reply With Quote
Old 12-24-2018, 01:58 PM   #2
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,869
Thanks: 114
Thanked 2,968 Times in 2,702 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Combobox brain teaser

Suggest you read this thread where I think you may find at least part of your answer
https://www.access-programmers.co.uk...d.php?t=302118
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 12-24-2018, 03:52 PM   #3
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,301
Thanks: 430
Thanked 783 Times in 760 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: Combobox brain teaser

I haven't looked at Colin's link, but I got around this by the following

Code:
Private Sub Form_Current()
Dim strCWSource As String, strActive As String, strOrder As String
strCWSource = "SELECT Lookups.ID, Lookups.Data From Lookups"
strCWSource = strCWSource & " WHERE ((Lookups.DataType) = 'Email')"
strActive = " And ((Lookups.DataActive) = True)"
strOrder = " ORDER BY Lookups.Data"

Me.CaseWorker.RowSource = strCWSource

If Me.NewRecord Then
    Me.CaseWorker.RowSource = strCWSource & strActive
    Me.TransactionDate.SetFocus
End If
Me.CaseWorker.RowSource = Me.CaseWorker.RowSource & strOrder
'Debug.Print Me.CaseWorker.RowSource

End Sub
HTH

__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Gasman; 12-25-2018 at 03:04 AM.
Gasman is online now   Reply With Quote
Reply

Tags
combo box

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox Brain Poot TxSteve Forms 6 08-29-2007 10:20 AM
Brain Teaser Spectacular! CharlesWhiteman Modules & VBA 1 03-23-2007 05:41 PM
Here's a Teaser aziz rasul Queries 2 10-28-2003 03:37 AM
Real Brain teaser!! john122 Modules & VBA 1 03-21-2002 06:50 AM
Help with string parsing/manipulation (Brain Teaser). Talismanic Modules & VBA 23 08-08-2001 07:27 AM




All times are GMT -8. The time now is 01:01 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World