Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / June 2007

Tip: Looking for answers? Try searching our database.

Duplicate entries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Asif - 20 Jun 2007 10:16 GMT
I have a table tbl_Cost. In my form I have a combo box (cmb_Year) and
a textbox (Text7). Now the control source of Text 7 is

=DLookUp("[COSTYear]","[tbl_COSTAPPEND]","[cmb_Year] =[COSTYear] ")

The rowsource of the cmb_Year is

SELECT tbl_YEAR.YEARID, tbl_YEAR.YEAR
FROM tbl_YEAR;

On the After update event of this combo box I have the following code;

Me.Refresh
If Me.cmb_Year = Me.Text7 Then
MsgBox ("Duplicate")
End If

Now if I select the year 2007 from cmb_Year then Text 7 will also
display 2007, but if i select 2008 from cmb_Year then Text 7 will be
empty. However the above code doesn't work as I want it to if the
above condition is true a message box doesn't appear, is there
something wrong with my code

Thanks
Muriukis - 20 Jun 2007 10:36 GMT
> I have a table tbl_Cost. In my form I have a combo box (cmb_Year) and
> a textbox (Text7). Now the control source of Text 7 is
[quoted text clipped - 22 lines]
>
> Try to use a macro
Asif - 20 Jun 2007 10:46 GMT
Tried that doesn't work I'm thinking could it be something to do with
the settings of the combo box i.e. if i change the bound to column
number to 1 then nothing is displayed but if i change it to 2 Text7
shows a value
Asif - 20 Jun 2007 11:43 GMT
I think I've solved the problem the field CostYear was set to a number
field once I changed it to a text field it worked, but what I can't
understand is why doesn't it the code work if the field setting for
CostYear was set to Number?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.