Combining two types of functions. Select Query and DLookup

I would like to write a code that performs the following action:
1. If the value in a comboBox  Project Number is 19912
2. Perform a select query on comboBox Task Number and comboBox National Site 
ID
3. If the value in a comboBox  Project Number is not 19912
4. Perform a select query on comboBox Task Number and a DLookup () on 
comboBox National Site ID

I tried the code below but it's not working. Any ideas on how to do this?

If Me.cmbProjectNumber.Value="19912" then
   cmbNationalSiteID.RowSource = "SELECT DISTINCT [National Site ID] FROM 
   [InScope Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value 
   & "'" & " ORDER BY [National Site ID]"
   cmbNationalSiteID = Null
   cmbNationalSiteID.Requery
Else
   cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope 
Table]","[Project  
   Number]='" & Forms![InscopeSiteSummary]!cmbProjectNumber & "'" & " And 
   [Task Number]='" & Forms![InscopeSiteSummary]!cmbTaskNumber & "'"),"") 
End If

Any help will be greatly appreciated.
 Thanks.

0
Utf
2/3/2008 2:44:00 AM
access 16762 articles. 3 followers. Follow

4 Replies
790 Views

Similar Articles

[PageSpeed] 10

Ayo,
try this.
I have changed some of the quotes
and added Me.to cmbNationalSiteID
added a couple of variables to make the code easier to read

Dim strSQL as String
Dim strCriteria as String

Me.cmbNationalSiteID = Null

With Forms![InscopeSiteSummary]
    strCriteria = "([Project Number]=""" & .cmbProjectNumber & """) AND
   ([Task Number]=""" & .cmbTaskNumber & "'")"
End With

If Me.cmbProjectNumber.Value="19912" then
    strSQL= "SELECT DISTINCT [National Site ID] FROM
   [InScope Table] WHERE [Project Number]=""" & Me.cmbProjectNumber  & """ 
ORDER BY [National Site ID]"
    Debug.Print strSQL
   Me.cmbNationalSiteID.RowSource = strSQL
Else
   Me.cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope Table]", 
strCriteria), "")
End If

Jeanette Cunningham

"Ayo" <Ayo@discussions.microsoft.com> wrote in message 
news:FAD4132A-BB55-4274-AA06-0EF0ECEADD22@microsoft.com...
>I would like to write a code that performs the following action:
> 1. If the value in a comboBox  Project Number is 19912
> 2. Perform a select query on comboBox Task Number and comboBox National 
> Site
> ID
> 3. If the value in a comboBox  Project Number is not 19912
> 4. Perform a select query on comboBox Task Number and a DLookup () on
> comboBox National Site ID
>
> I tried the code below but it's not working. Any ideas on how to do this?
>
> If Me.cmbProjectNumber.Value="19912" then
>   cmbNationalSiteID.RowSource = "SELECT DISTINCT [National Site ID] FROM
>   [InScope Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value
>   & "'" & " ORDER BY [National Site ID]"
>   cmbNationalSiteID = Null
>   cmbNationalSiteID.Requery
> Else
>   cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope
> Table]","[Project
>   Number]='" & Forms![InscopeSiteSummary]!cmbProjectNumber & "'" & " And
>   [Task Number]='" & Forms![InscopeSiteSummary]!cmbTaskNumber & "'"),"")
> End If
>
> Any help will be greatly appreciated.
> Thanks.
> 


0
Jeanette
2/3/2008 4:13:14 AM
Thanks Jeanette. I figured out out another way to do what I wanted to do.

"Jeanette Cunningham" wrote:

> Ayo,
> try this.
> I have changed some of the quotes
> and added Me.to cmbNationalSiteID
> added a couple of variables to make the code easier to read
> 
> Dim strSQL as String
> Dim strCriteria as String
> 
> Me.cmbNationalSiteID = Null
> 
> With Forms![InscopeSiteSummary]
>     strCriteria = "([Project Number]=""" & .cmbProjectNumber & """) AND
>    ([Task Number]=""" & .cmbTaskNumber & "'")"
> End With
> 
> If Me.cmbProjectNumber.Value="19912" then
>     strSQL= "SELECT DISTINCT [National Site ID] FROM
>    [InScope Table] WHERE [Project Number]=""" & Me.cmbProjectNumber  & """ 
> ORDER BY [National Site ID]"
>     Debug.Print strSQL
>    Me.cmbNationalSiteID.RowSource = strSQL
> Else
>    Me.cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope Table]", 
> strCriteria), "")
> End If
> 
> Jeanette Cunningham
> 
> "Ayo" <Ayo@discussions.microsoft.com> wrote in message 
> news:FAD4132A-BB55-4274-AA06-0EF0ECEADD22@microsoft.com...
> >I would like to write a code that performs the following action:
> > 1. If the value in a comboBox  Project Number is 19912
> > 2. Perform a select query on comboBox Task Number and comboBox National 
> > Site
> > ID
> > 3. If the value in a comboBox  Project Number is not 19912
> > 4. Perform a select query on comboBox Task Number and a DLookup () on
> > comboBox National Site ID
> >
> > I tried the code below but it's not working. Any ideas on how to do this?
> >
> > If Me.cmbProjectNumber.Value="19912" then
> >   cmbNationalSiteID.RowSource = "SELECT DISTINCT [National Site ID] FROM
> >   [InScope Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value
> >   & "'" & " ORDER BY [National Site ID]"
> >   cmbNationalSiteID = Null
> >   cmbNationalSiteID.Requery
> > Else
> >   cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope
> > Table]","[Project
> >   Number]='" & Forms![InscopeSiteSummary]!cmbProjectNumber & "'" & " And
> >   [Task Number]='" & Forms![InscopeSiteSummary]!cmbTaskNumber & "'"),"")
> > End If
> >
> > Any help will be greatly appreciated.
> > Thanks.
> > 
> 
> 
> 
0
Utf
2/3/2008 4:40:00 AM
Glad you got it working.

Jeanette Cunningham

"Ayo" <Ayo@discussions.microsoft.com> wrote in message 
news:47BE55AE-E485-42C2-AEC1-89AD09D9FBE4@microsoft.com...
> Thanks Jeanette. I figured out out another way to do what I wanted to do.
>
> "Jeanette Cunningham" wrote:
>
>> Ayo,
>> try this.
>> I have changed some of the quotes
>> and added Me.to cmbNationalSiteID
>> added a couple of variables to make the code easier to read
>>
>> Dim strSQL as String
>> Dim strCriteria as String
>>
>> Me.cmbNationalSiteID = Null
>>
>> With Forms![InscopeSiteSummary]
>>     strCriteria = "([Project Number]=""" & .cmbProjectNumber & """) AND
>>    ([Task Number]=""" & .cmbTaskNumber & "'")"
>> End With
>>
>> If Me.cmbProjectNumber.Value="19912" then
>>     strSQL= "SELECT DISTINCT [National Site ID] FROM
>>    [InScope Table] WHERE [Project Number]=""" & Me.cmbProjectNumber  & 
>> """
>> ORDER BY [National Site ID]"
>>     Debug.Print strSQL
>>    Me.cmbNationalSiteID.RowSource = strSQL
>> Else
>>    Me.cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope Table]",
>> strCriteria), "")
>> End If
>>
>> Jeanette Cunningham
>>
>> "Ayo" <Ayo@discussions.microsoft.com> wrote in message
>> news:FAD4132A-BB55-4274-AA06-0EF0ECEADD22@microsoft.com...
>> >I would like to write a code that performs the following action:
>> > 1. If the value in a comboBox  Project Number is 19912
>> > 2. Perform a select query on comboBox Task Number and comboBox National
>> > Site
>> > ID
>> > 3. If the value in a comboBox  Project Number is not 19912
>> > 4. Perform a select query on comboBox Task Number and a DLookup () on
>> > comboBox National Site ID
>> >
>> > I tried the code below but it's not working. Any ideas on how to do 
>> > this?
>> >
>> > If Me.cmbProjectNumber.Value="19912" then
>> >   cmbNationalSiteID.RowSource = "SELECT DISTINCT [National Site ID] 
>> > FROM
>> >   [InScope Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value
>> >   & "'" & " ORDER BY [National Site ID]"
>> >   cmbNationalSiteID = Null
>> >   cmbNationalSiteID.Requery
>> > Else
>> >   cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope
>> > Table]","[Project
>> >   Number]='" & Forms![InscopeSiteSummary]!cmbProjectNumber & "'" & " 
>> > And
>> >   [Task Number]='" & Forms![InscopeSiteSummary]!cmbTaskNumber & 
>> > "'"),"")
>> > End If
>> >
>> > Any help will be greatly appreciated.
>> > Thanks.
>> >
>>
>>
>> 


0
Jeanette
2/3/2008 7:50:52 AM
je vous trouve tous sympa

"Jeanette Cunningham" <nnn@discussions.microsoft.com> a �crit dans le 
message de groupe de discussion : uYaiCmjZIHA.4808@TK2MSFTNGP05.phx.gbl...
> Glad you got it working.
>
> Jeanette Cunningham
>
> "Ayo" <Ayo@discussions.microsoft.com> wrote in message 
> news:47BE55AE-E485-42C2-AEC1-89AD09D9FBE4@microsoft.com...
>> Thanks Jeanette. I figured out out another way to do what I wanted to do.
>>
>> "Jeanette Cunningham" wrote:
>>
>>> Ayo,
>>> try this.
>>> I have changed some of the quotes
>>> and added Me.to cmbNationalSiteID
>>> added a couple of variables to make the code easier to read
>>>
>>> Dim strSQL as String
>>> Dim strCriteria as String
>>>
>>> Me.cmbNationalSiteID = Null
>>>
>>> With Forms![InscopeSiteSummary]
>>>     strCriteria = "([Project Number]=""" & .cmbProjectNumber & """) AND
>>>    ([Task Number]=""" & .cmbTaskNumber & "'")"
>>> End With
>>>
>>> If Me.cmbProjectNumber.Value="19912" then
>>>     strSQL= "SELECT DISTINCT [National Site ID] FROM
>>>    [InScope Table] WHERE [Project Number]=""" & Me.cmbProjectNumber  & 
>>> """
>>> ORDER BY [National Site ID]"
>>>     Debug.Print strSQL
>>>    Me.cmbNationalSiteID.RowSource = strSQL
>>> Else
>>>    Me.cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope 
>>> Table]",
>>> strCriteria), "")
>>> End If
>>>
>>> Jeanette Cunningham
>>>
>>> "Ayo" <Ayo@discussions.microsoft.com> wrote in message
>>> news:FAD4132A-BB55-4274-AA06-0EF0ECEADD22@microsoft.com...
>>> >I would like to write a code that performs the following action:
>>> > 1. If the value in a comboBox  Project Number is 19912
>>> > 2. Perform a select query on comboBox Task Number and comboBox 
>>> > National
>>> > Site
>>> > ID
>>> > 3. If the value in a comboBox  Project Number is not 19912
>>> > 4. Perform a select query on comboBox Task Number and a DLookup () on
>>> > comboBox National Site ID
>>> >
>>> > I tried the code below but it's not working. Any ideas on how to do 
>>> > this?
>>> >
>>> > If Me.cmbProjectNumber.Value="19912" then
>>> >   cmbNationalSiteID.RowSource = "SELECT DISTINCT [National Site ID] 
>>> > FROM
>>> >   [InScope Table] WHERE [Project Number]='" & 
>>> > Me.cmbProjectNumber.Value
>>> >   & "'" & " ORDER BY [National Site ID]"
>>> >   cmbNationalSiteID = Null
>>> >   cmbNationalSiteID.Requery
>>> > Else
>>> >   cmbNationalSiteID=Nz(DLookup("[National Site ID],"[Inscope
>>> > Table]","[Project
>>> >   Number]='" & Forms![InscopeSiteSummary]!cmbProjectNumber & "'" & " 
>>> > And
>>> >   [Task Number]='" & Forms![InscopeSiteSummary]!cmbTaskNumber & 
>>> > "'"),"")
>>> > End If
>>> >
>>> > Any help will be greatly appreciated.
>>> > Thanks.
>>> >
>>>
>>>
>>>
>
> 
0
diop
2/3/2008 11:19:56 AM
Reply:

Similar Artilces:

Testing a range of cells in an IF FUNCTION
Trying to test a range of cells in an IF Function. I would like the function to look at 15 cells in a single row, find a value within those cells, and then return another value if TRUE/FALSE. As of now, I can only apply the "logical test" in the IF formula for ONE CELL ONLY. I would like it to test a RANGE of cells in one row, find if any of the values match my logical test, and then return a value. Anyone understand or know how to do this? I tried apply "lookup" function, but I don't think it will work Please help Aaro aaronplange at hotmail.com Hi maybe someth...

Query Problems
I have a table of ecards that is populated from a website and includes receiver, sender, and Team leader. The problem I am having is names can be entered into the table like this "Tom Thumb", but Team leader is a dropdown menu that is constant and lists name like this: "Tom S. Thumb". When I make a query to find all the members of Tom S. Thumb's team, I get everyone except Tom Thumb, who is member too. Tom Thumb has his own higher team leader, so I can't change that. How do I get Tom Thumb to be included when I enter "Tom S. Thumb" as Team Leader? ...

Changing to Combination-chart from existing chart
I have made a Line-chart containing 8 different series. I now want to change 2 of the series to Bars, but in the same chart. How do I proceed to pick the wanted series and transform them to bars? Regards Jan Hi Jan, Right click a line series that you wish to change. From the popup menu select Chart type and pick bar. Cheers Andy Jan wrote: > I have made a Line-chart containing 8 different series. I > now want to change 2 of the series to Bars, but in the > same chart. > > How do I proceed to pick the wanted series and transform > them to bars? > > Reg...

Excel web query returns no data
When I enter a web addreess into IE it shows the page When I set up a web query in Excel it allows me to select the relevant tables, but then returns no data The same Excel query worked on previuous versions of Excel Web address for query http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBM DataServlet?param1=T_CNQPS- 4&param2=&param3=&param4=&param5=2001-04-01&param6=* Any help appreciated ...

Query to Mail Merge issue
I am running Access2003 on WinXP SP2. I send out dues letters for members of a retiree group. When I try to do a mail merge to my Dues Query all goes fine except the telephone number in the query which is (555)555-1234 comes out 5555551234. If I copy the query into an excel spreadsheet and use that as the datasource for the mail merge it works fine. Is there something I need to do to format the query so it merges with the right format. Thanks Billa In the query format the field to include the parentheses and dash. In query design view, instead of the field name put an expression alo...

Combiner Tools in PSTL
hello there, our company wanted to delete customers/vendors/items in GP however we realized that we cannot delete them as there is history against these records. We decided to create a temp/dummy record for each (i.e. dummy customer, vendor, item) and combine those records per module we wanted to initially deleted into these dummy records using the combiner tools. Has anyone done this before and is there any issues with doing it this way? i also think the item combiner tools has some rules to be met before certain items can be combined, is this documented anywhere so we can check as there s...

Permutation and combination
I have 20,000 data in excel. If I add some numbers I will get sum 694,569. It’s very difficult to find out in such a big sheet. Is there any formula/Macro to know those numbers? This is permutation and combination related. regards vishu when you say 'add some numbers' do you mean like with a sum if??? example your numbers are ( 1,2,3,4,5,6,7,8,9,10 ) BUT you only want to add ( 3,4,5,8,9 ) so your total is 29 and you want to know what numbers were added?? If this is correct, Make a pivot table. it can group the numbers how you want to add them, then if you double click a ...

Export query to Excel with formated heading
When export from query to Excel, I'd like to turn some columns into heading row on top of Excel sheets how to turn this: LastName FirstName SID Section Instructor Doe John 1234 0545 Su Doe Jane 2345 0545 Su into this? Class Roster Instructor: Su Section: 0545 LastName FirstName SID Doe John 1234 Doe Jane 2345 I think one way of achieving this would be to create a report in Access where you would group under instructor with the students in the detail section. From the report you can then use the analyze with Ex...

Re: Function to copy data from a variable range?
I have a sheet with about 20,000 lines of data. From that sheet I am looking to group the data based on a parameter, into multiple different sheets. ie: If the category is "1" copy all that lines data into sheet A, If the category is "2", copy all the lines into sheet B. The problem is, the number of lines for each acatgeory type is not always the same. Some categories may only have 1 or two lines, other may have 200-300. Is there any type of function for this? Thanks! Doable but why not just use data>filter>autofilter -- Don Guillett Microsoft MVP Excel SalesA...

How can I combine data from a list?
For example: suppose I had a very simple list, with two columns: "Name" and "Number". The category "name" has three items: Dog, Cat, and Dog. Each of those three items has a corresponding "number" value: 3, 4, and 5. I'm trying to find a function that would recognize the fact that I have "Dog" listed twice, and would sum the 3 & 5 values listed next to each "Dog", leaving me with a two-item list: Dog, 8 & Cat, 4. Is there a way to do this? A Pivot Table will do that nicely for you: Set the Name as a ROW and the ...

instructions disppear when users begin type (text field)
Hi all, I need to customize the outlook contact form and I want to add one text field to allow users to add details info and instruct users how to add. Instructions shows in the field and the instructions disappear when users click and begin to type. How should I do this? exchange 2003/outlook2003 Thank you. It's hard for me to visualize exactly what you're expecting to happen. If you want the instructions to stay on the screen, you could display them in a label control. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumps...

How do I merge two publisher files?
I am using publisher 2003. I am creating an 80 page catalog. I like to save page 1-10 as file one, pages 11-20 as file two and so on. When I am finished with my catalog I need to send one file to the printer. How can I merge all of my pages together in one file? Copy and paste. Or if you have Acrobat (not just the free Reader) you can create a single .pdf file with the parts. -- JoAnn Paules MVP Microsoft [Publisher] "screnda" <screnda@discussions.microsoft.com> wrote in message news:CF96E50B-CBC8-4A5A-A854-D7EE130CE9AD@microsoft.com... >I am using publisher 200...

Should unimplmented pure function throw a compile error?
It's been a while since I have written anything with abstract classes. If I derive a class from my abstract class and do not implement a pure virtual function of the base class in the derived class, shouldn't the compiler throw an error? -- Bruce E. Stemplewski GarXface OCX and C++ Class Library for the Garmin GPS www.stempsoft.com yes, if you try to instantiate the class in your code it should. "Bruce E. Stemplewski " <BruceStemplewski@hotmail.com> wrote in message news:uaGJZhYCFHA.3732@TK2MSFTNGP14.phx.gbl... > It's been a while since I have written anyt...

Query Criteria issue
Access 2003: Trying to create a demographics report that will allow the following. Gender example On the form "frmStudentDemographics" is a drop down field named "cboGender" When the user makes a selection "Male" a report is generated for only Males. But in some cases the user will want to run a report for both (all) genders. So I added a check box next to the drop down named "ckAllGender" My idea is that if that box is checked then the report will show information on Both (all) genders. So in the query that generates the report, in the c...

function keys
Hello, Is there a site where I can get a recap of RMS function keys? Not that I know of, but F1 - Help is a really good place to start! Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.com ---------------------------------------------- Please DO NOT respond to me directly but post all responses here in the newsgroup so that all can share the information. newbie wrote: > Hello, > Is there a site where I can get a recap of RMS function keys? This is a multi-part message in MIME format. ------=_NextPart_000_02DF_01C6B6FC.B3481FA0 Content-Type: text/plain; ...

Change Backcolor for the selected line
I would like to be able to highlight or change the color of a single line on a subform formated as a continuous form. The user selects one line from many possible lines on a continuous form to respond to. When he selects the line another pop-up form is display which the user must complete. I would like to maintain some kind of highlight (backcolor?) so that the user can clearly see which line he is reponding to. Setting the backcolor after selecting a line sets the back color for the entire form, which really defeats the purpose. Any help? -- Message posted via AccessMons...

Using two conditions in a formula
How do I write the following formula: I am in cell I6 If g6 AND h6 is blank, then blank, else I5 minus g6 plus h -- Richard Pit ----------------------------------------------------------------------- Richard Pitt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1533 View this thread: http://www.excelforum.com/showthread.php?threadid=27042 Richard, In cell I6, enter the formula: =IF(AND(G6="",H6=""),"",I5-G6-H6) Though you don't check for case when G6 is blank and H6 isn't, etc. HTH, Bernie MS Excel MVP "Richard ...

Windows and Mac have two distinctly different units for column width.
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am trying to format columns for some data I am entering in a spreadsheet and when I enter &quot;15.00&quot;, which is the required width for these columns given by my professor, I end up with a column 15 inches wide. What I would prefer is for the options to be like the default options in Windows version of Excel. In Windows version of Excel, when you hover over the lines between the columns it gives you two numbers (e.g. 8.43 (64 pixels)). These are the default numbers for column width in Windows Excel....

Spontaneous 'Compile Error' In Queries
I've got a half-dozen queries that contain this expression: IssuerName: IIf(IsNull([tblIssuer].[IssuerID]),"[Issuer Unknown]",[tblIssuer].[IssuerName]) Haven't touched any of them, but suddenly they were all throwing "Compile error. in query expression 'IssuerName: IIf(IsNull([tblIssuer].[IssuerID]),"[Issuer Unknown]",[tblIssuer].[IssuerName])'." tblIssuer.IssuerID is still there in a link. My kneejerk was to somehow force recompiles of all the queries, so I did a Compact/Repair. After the compact/repair, all was well: the errors went away. C...

Data types.
Hello, I have TextBox1 with this Value = 57.7 I need do something like this MyNewVar = CDbl(TextBox1) .... but this is Type mismatch error 13 I need transform text value to number value. Thanks Tom I found the problem. I need transform 57.7 to 57,7 "Tom" <tom@fake.com> p�e v diskusn�m p��sp�vku news:ezqjoGcLEHA.2260@TK2MSFTNGP09.phx.gbl... > Hello, > > I have TextBox1 with this Value = 57.7 > I need do something like this > > MyNewVar = CDbl(TextBox1) .... but this is Type mismatch error 13 > > I need transform text value to number value. > &g...

Attach Trigger to Save Function of Form
I am in the processes of trying to attach a trigger to the Save function of an already existing GP form using Dex. In one of the documents, it states that the CM_Checkbook_Maitenance has a SaveRecord function. I am trying to acces the function that is similar to this on the PM_Vendor_Maitenance form. I tried using SaveRecord and when I tried to compile it it says that it is an unknown reference. Is there some documentation with a list of the functions for each form? Mike, PM_Vendor_Maintenance is an older form and probably doesn't have a SaveRecord function. Try running t...

Combine small documents into one master document
Hi, I currently have an "engagement letter" that is created for our clients to set the expectations for our business relationship (I work for attorneys). We have about 10 different paragraphs that may be inserted into the letter based on different factors (3rd party payor, if a retainer is required, etc.). So I start with the basic letter and then have a userform with checkboxes where you can select the text block options (stored in Autotext). When you click OK the various paragraphs are inserted at bookmarks. While this works, I find working with Autotext cumber...

Multi-Select Listbox VBA code causing overflow in loop
Private Sub Form_Current() Dim oItem1 As Variant Dim oItem2 As Variant Dim bFound1 As Boolean Dim bFound2 As Boolean Dim sTemp1 As String Dim sTemp2 As String Dim sValue1 As String Dim sValue2 As String Dim sChar1 As String Dim sChar2 As String Dim iCount1 As Integer Dim iCount2 As Integer Dim iListItemsCount1 As Integer Dim iListItemsCount2 As Integer sTemp1 = Nz(Me!SignsList.Value, " ") sTemp2 = Nz(Me!SymptomsList.Value, " ") iListItemsCount1 = 0 iListItemsCount2 = 0 bFound1 = False bFound2 ...

Re-exporting functions from dynamically linked DLL
Hi, I have the following situation: I have a 3rd party DLL which does not include a LIB file, just a header file with typedef declarations for exported functions (It is intended for dynamic linking) I need to wrap the DLL to allow for callbacks to my own code (in Lisp), and to do this I need to load the DLL using LoadLibrary and access each function that I need using GetProcAddress. So for example: The third party header will say: typedef INT (WINAPI * lp_function)(); Then in my c wrapper file: #include "3rdparty.h" #ifdef _WIN32 #define DllExport __declspec(dllexport) #else #...

Dlookup turn -1 or 0 into a word
I have a message box that displays if a product is 'Stocked' or 'Not STocked' but in the databse its stored as -1 or 0 I use the follwoing code DLookup("StockedItem", "tblProduct", "ProductID=" & Me.ProductID) So in the message box at the moment it says -1 or 0, how do i code it to says 'stocked' if -1 and 'Not STocked' if 0 Thanks Assuming ever field has a value: If Stocked = -1 Then MsgBox "Stocked", vbOKOnly Else MsgBox "Not Stocked", vbOKOnly End If -- Arvin Meyer, MCP, MV...