Results 1 to 10 of 10
  1. #1
    nkuebelbeck is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    91

    Pulling data from a scale

    I have one of these http://www.taltech.com/products/winwedge and need to be able to pull the data off it. My plan was to create a button that grabs the data but its not working.

    Here is my code

    Function GetWedgeData()
    Dim MyData As String, Chan As Long
    Chan = DDEInitiate("WinWedge", "Com1")
    MyData = DDERequest(Chan, "FIELD(1)")
    DDETerminate Chan
    If Len(MyData) = 0 Then


    Dim err As String
    err = "No Data, check connections"
    MsgBox (err)
    Else
    MsgBox (MyData)
    End If

    End Function

    When I call the GetWedgeData() function I get this.

    "run time error 282 Microsoft Access can't find the application and topic because it can't open the DDE Channel"

    I'm new to DDE so any nudge in the right direction would be greatly appreciated.

    The scale is connected via serial port. Windows XP x86 SP3

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    I tested DDE code in Word to pull data from Access table. It worked. The tutorial said Access had to be open. I assume you have the WinWedge app open? That company claims unlimited tech support. Shouldn't they be able to provide you guidance?

    Maybe this is an option http://office.microsoft.com/en-us/ac...001228819.aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,724
    I agree with June - contact tech support at the comapny. Did they provide you with sample applications?

  4. #4
    nkuebelbeck is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    91
    ok, got this to work. Turns out the scale is just had some really goofy COM settings.

    So Now I have it to where when I push the button on the scale its popping up a msg box with the weight. My questions is how do I go the other way. How Do I make Access Pull the data?

    I will be in touch with support but i've had such good luck with this forum

    DDE is new to me

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    Well, I expect the WinWedge app must save the data somewhere. Maybe they use an Access db for this. I use an app called Paver that does this. That app saves data to an unprotected Access db and I can work with it just like any Access db (link tables, etc). If they do use an unprotected Access, then you can link directly to the tables. If WinWedge uses protected Access or some other database for backend, is there something in the install process where you identify fieldnames or something like that? This link shows Word pulling data from Access through DDE connection http://msdn.microsoft.com/en-us/libr...ffice.11).aspx Note code for the app name and path. I guess Access VBA would do something similar to the WinWedge file. That, or WindWedge must push the data to Access.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    nkuebelbeck is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    91
    http://www.ohaus.ca/PU/PDF/AVPro.pdf here is my scale. Its interesting. I believe it takes commands and I believe winwedge should be able to send them.

    As far as the data goes I can't find where the data is stored. Sure isn't an access database.

    What I am trying to do should be possible....

    More to come i'm sure.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    It HAS to be possible, the software builder claims it is. Interested in what tech support tells you.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    nkuebelbeck is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    91

    here is the note from the manufacturer

    "Hello Nathan,

    You need to send an upper case P followed by a Carriage Return and Line
    Feed."

    Then I replied:
    "Do I need to serial two serial ports? Or will it send and receive out through one port"

    And they replied:
    "It sends and receives using the same port."

    So, with a little bit of luck I should be able to send and receive it into a text box using code. More to come.

  9. #9
    nkuebelbeck is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    91

    very close.

    I've got my function above setting MyData to the scale data.

    stupid question

    How do I set the value of a text box equal to that value?

    I thought I could do something like this txtbox.value = GrabWedgeData

    what am I doing wrong?

  10. #10
    nkuebelbeck is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Mar 2010
    Posts
    91
    nevermind. Figured it out. Thanks all for the help

    Just had to set the function GetWedgeData = Mydata

    then in the form txtbox.value = GetWedgeData

    woot!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pulling data based off a list
    By Kookymonster in forum Import/Export Data
    Replies: 9
    Last Post: 08-15-2011, 12:54 PM
  2. Listview pulling data from a second table
    By Yesideez in forum Access
    Replies: 8
    Last Post: 06-29-2011, 05:08 AM
  3. Reports not pulling data correctly
    By yes sir in forum Access
    Replies: 13
    Last Post: 04-01-2011, 09:13 PM
  4. Relationships and pulling data.
    By Subhunter in forum Queries
    Replies: 2
    Last Post: 02-08-2011, 01:18 PM
  5. Pulling only certain data from tables.
    By stevman22889 in forum Access
    Replies: 2
    Last Post: 07-15-2010, 06:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums