What recordset now called can somebody please correct this code? MIchael Horton

Private Sub ShowRecord_Click()
Dim rst As DAO.Recordset
Set rst = [Forms]![Assets].RecordsetClone
rst.FindFirst "InvestID=" & List2
[Forms]![Assets].Bookmark = rst.Bookmark
DoCmd.Close acForm, "GoToRecordDialog"
End Sub

You can cater for Nulls by executing the code conditionally.  Also it's advisable to examine the NoMatch property before synchronizing the bookmarks, e.g.
Const MESSAGETEXT1 = "No asset selected."
Const MESSAGETEXT2 = "No matching record found."
Dim frm as Form
Set frm = Forms("Assets")
If Not IsNull(Me.List2) Then
   With frm.RecordsetClone
       .FindFirst "InvestID = " & Me.List2
       If Not .NoMatch Then
           frm.Bookmark = .Bookmark
           DoCmd.Close acForm, Me.Name
       Else
           MsgBox MESSAGETEXT2, vbInformation, "Warning"
       End if
    End With
Else
    MsgBox MESSAGETEXT1, vbExclamation, "Invalid Operation"
End If
This does assume of course that the list box's bound column is that containing the InvestID values.
PS:  It also assumes that the list box is not a multi-select control.
Ken Sheridan, Stafford, England

Similar Messages

  • Can anyone please explain this code to me?

    I am a new (junior)programmer?Can anyone please explain this code to me in lame terms? I am working at a client location and found this code in a project.
    _file name is AtccJndiTemplate.java_
    Why do we use the Context class?
    Why do we use the properties class?
    package org.atcc.common.utils;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    import java.util.logging.Logger;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import org.springframework.jndi.JndiTemplate;
    public class AtccJndiTemplate extends JndiTemplate
      private static Logger logger = Logger.getLogger(AtccJndiTemplate.class.getName());
      private String jndiProperties;
      protected Context createInitialContext()
        throws NamingException
        Context context = null;
        InputStream in = null;
        Properties env = new Properties();
        logger.info("Load JNDI properties from classpath file " + this.jndiProperties);
        try
          in = AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
          env.load(in);
          in.close();
        catch (NullPointerException e) {
          logger.warning("Did not read JNDI properties file, using existing properties");
          env = System.getProperties();
        } catch (IOException e) {
          logger.warning("Caught IOException for file [" + this.jndiProperties + "]");
          throw new NamingException(e.getMessage());
        logger.config("ENV: java.naming.factory.initial = " + env.getProperty
    ("java.naming.factory.initial"));
        logger.config("ENV: java.naming.factory.url.pkgs = " + env.getProperty
    ("java.naming.factory.url.pkgs"));
        logger.info("ENV: java.naming.provider.url = " + env.getProperty
    ("java.naming.provider.url") + " timeout=" + env.getProperty("jnp.timeout"));
        context = new InitialContext(env);
        return context;
      public String getJndiProperties()
        return this.jndiProperties;
      public void setJndiProperties(String jndiProperties)
        this.jndiProperties = jndiProperties;
    }

    Hi,
    JNDI needs some property such as the
    java.naming.factory.initial
    java.naming.provider.url
    which are needed by the
    InitialContext(env);
    where env is a properties object
    Now if you can not find the physical property file on the class path
    by AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
    where the String "jndiProperties" get injected by certain IOC ( inverse of control container ) such as Spring framework
    if not found then it will take the property from the system which will come from the evniromental variables which are set during the application start up i.e through the command line
    java -Djava.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory -Danother=value etc..
    I hope this could help
    Regards,
    Alan Mehio
    London,UK

  • Can someone please proof this code writing to my db...

    i have this code that was working and i moved it around a
    little and now i'm getting errors when it tries to write to the db.
    if the user enters a valid credit card number (basic check that
    i've tested and i know this part works fine but still wanted to
    show all the code) it is supposed to write all the info from the
    previous page's form into the db. i'm sure it's something small and
    stupid, but i need to get this up and running immediately.
    thanks in advance for any help...

    A side note, you're storing unencrypted credit card
    information in your database and this is a violation of the credit
    card regulations (
    PCI).
    Because of the liability factor, I suggest that you do not store
    credit card information at all and instead use some form of
    Tokenization
    (different providers call it different names). At the very minimum,
    if you don't use tokenization or something similar, you MUST
    encrypt the data with a 128bit encryption method of better (3DES,
    Blowfish, AES, etc.).

  • Can somebody please try this?

    If you run OS X 10.5.5 Leopard and have iPhoto 08 installed, could you please start iPhoto 08 and put a comment in one of your photos. The comment should contain a word that no other comment contains. Close iPhoto. Wait a while. Then, use the Spotlight search (magnifying glass in upper right corner of screen) to search for the keyword. Does Spotlight find your photo? I think it should, but mine doesn't.
    Thanks,
    Richard

    Spotlight in OS X 10.4.11 works with iPhoto 08. The Photo Library is a bundle. When I click on a photo in Spotlight it opens iPhoto and highlights the photo. This is what happens when I click on an event or a mail in Spotlight, i.e., the application opens and highlights the object. This behavior prevents somebody from modifying the object directly. As I stated in a previous post, I am almost sure this used to work in a previous version of Leopard.
    Background info: Spotlight uses plugins to index files created by applications. Some plugins are located in /Library/Spotlight, some in /System/Library/Spotlight, and others in the application bundles themselves. In the first library one finds the importers for the Microsoft products, but also for iWeb. The one for iPhoto is in the second. The architecture is well conceived, but something isn't working properly here that used to. I cannot imagine that it suddenly shouldn't, at least not for the reasons stated above.

  • Can somebody please read this minidump file for me?

    Hey everyone, I've been getting the BSOD lately (every time I try to boot to windows 7). Safe mode w/ networking works fine, and so does Snow Leopard, so it's not hardware. My guess is that it's either low on HDD space or the GPU drivers are broken. I can't open the minidump file, so I was hoping one of you could do it for me. Thanks for your help in advance.
    Here is a link to the download of the file: https://dl.dropbox.com/u/44854063/120912-16738-01.dmp

    Thanks for your help, I did all the things you mentioned, and got 283 errors in the event viewer and way too much information in the CBS file. Most of the errors seem to  be coming from "WMI", Bonjour service, and CAPI2. Restart manager also says that AVG isn't shutting down. What is WMI and is it the problem? Thanks.
    [edit] getting a lot of "dependency service of group failed to start." errors too. The first major error also seems to be:
    The AVGIDSAgent service depends on the AVGIDSDriver service which failed to start because of the following error:
    A device attached to the system is not functioning.
    Followed by this:
    The following boot-start or system-start driver(s) failed to load:
    AVGIDSDriver
    Avgldx64
    discache
    spldr
    Wanarpv6
    any ideas?

  • Can somebody please check this kernel panic

    I'm running Mavericks. Thanks
    UUID:       68A58EDF-AFCB-E588-472C-AB1283196649
    Sat Feb 28 22:29:58 2015
    panic(cpu 1 caller 0xffffff801a7e384b): "new_vnode(0xffffff8036774780): free vnode still referenced"@/SourceCache/xnu/xnu-2422.115.10/bsd/vfs/vfs_subr.c:3666
    Backtrace (CPU 1), Frame : Return Address
    0xffffff8131f13020 : 0xffffff801a623139
    0xffffff8131f130a0 : 0xffffff801a7e384b
    0xffffff8131f130d0 : 0xffffff801a7db66f
    0xffffff8131f13190 : 0xffffff801a962f94
    0xffffff8131f132a0 : 0xffffff801a97aa40
    0xffffff8131f13470 : 0xffffff801a96fb1f
    0xffffff8131f13b10 : 0xffffff801a96eaff
    0xffffff8131f13bf0 : 0xffffff801a7ff030
    0xffffff8131f13c70 : 0xffffff801a7efdb9
    0xffffff8131f13d70 : 0xffffff801a7efb6a
    0xffffff8131f13f50 : 0xffffff801aa419f3
    0xffffff8131f13fb0 : 0xffffff801a6f4c86
    BSD process name corresponding to current thread: mds
    Mac OS version:
    13F34
    Kernel version:
    Darwin Kernel Version 13.4.0: Wed Dec 17 19:05:52 PST 2014; root:xnu-2422.115.10~1/RELEASE_X86_64
    Kernel UUID: 45486BF2-BDDE-34CB-8C71-606FF3FE181B
    Kernel slide:     0x000000001a400000
    Kernel text base: 0xffffff801a600000
    System model name: MacBookPro7,1 (Mac-F222BEC8)
    System uptime in nanoseconds: 856979470963
    last loaded kext at 464675478490: com.apple.filesystems.afpfs 11.1 (addr 0xffffff7f9c9fc000, size 348160)
    last unloaded kext at 386616400329: com.apple.driver.AppleMCP89RootPortPM 1.11 (addr 0xffffff7f9c548000, size 24576)
    loaded kexts:
    com.vara.driver.VaraAudio 1.0.3
    com.rim.driver.BlackBerryUSBDriverInt 0.0.74
    com.apple.filesystems.afpfs 11.1
    com.apple.nke.asp-tcp 8.0.1
    com.apple.filesystems.msdosfs 1.9
    com.apple.driver.AppleHWSensor 1.9.5d0
    com.apple.filesystems.autofs 3.0
    com.apple.driver.AudioAUUC 1.60
    com.apple.driver.AGPM 100.14.34
    com.apple.iokit.IOBluetoothSerialManager 4.2.7f4
    com.apple.driver.AppleMikeyHIDDriver 124
    com.apple.driver.AppleHDA 2.6.3f4
    com.apple.driver.AppleSMCLMU 2.0.4d1
    com.apple.iokit.IOUserEthernet 1.0.0d1
    com.apple.Dont_Steal_Mac_OS_X 7.0.0
    com.apple.driver.AppleHWAccess 1
    com.apple.driver.AppleMikeyDriver 2.6.3f4
    com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0
    com.apple.driver.AppleBacklight 170.4.11
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.2.7f4
    com.apple.driver.AppleLPC 1.7.0
    com.apple.GeForceTesla 8.2.4
    com.apple.driver.AppleUpstreamUserClient 3.5.13
    com.apple.driver.AppleMCCSControl 1.2.5
    com.apple.driver.SMCMotionSensor 3.0.4d1
    com.apple.driver.AppleUSBTCButtons 240.2
    com.apple.driver.AppleUSBTCKeyboard 240.2
    com.apple.driver.AppleIRController 325.7
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeLZVN 1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0d1
    com.apple.BootCache 35
    com.apple.driver.AppleUSBCardReader 3.4.1
    com.apple.iokit.SCSITaskUserClient 3.6.7
    com.apple.driver.XsanFilter 404
    com.apple.iokit.IOAHCIBlockStorage 2.6.0
    com.apple.driver.AppleUSBHub 683.4.0
    com.apple.iokit.AppleBCM5701Ethernet 3.8.1b2
    com.apple.driver.AppleUSBOHCI 656.4.1
    com.apple.driver.AppleFWOHCI 5.0.2
    com.apple.driver.AppleAHCIPort 3.0.5
    com.apple.driver.AppleUSBEHCI 660.4.0
    com.apple.driver.AirPort.Brcm4331 700.20.22
    com.apple.driver.AppleSmartBatteryManager 161.0.0
    com.apple.driver.AppleRTC 2.0
    com.apple.driver.AppleHPET 1.8
    com.apple.driver.AppleACPIButtons 2.0
    com.apple.driver.AppleSMBIOS 2.1
    com.apple.driver.AppleACPIEC 2.0
    com.apple.driver.AppleAPIC 1.7
    com.apple.driver.AppleIntelCPUPowerManagementClient 217.92.1
    com.apple.nke.applicationfirewall 153
    com.apple.security.quarantine 3
    com.apple.driver.AppleIntelCPUPowerManagement 217.92.1
    com.apple.security.SecureRemotePassword 1.0
    com.apple.kext.triggers 1.0
    com.apple.AppleGraphicsDeviceControl 3.6.22
    com.apple.iokit.IOSerialFamily 10.0.7
    com.apple.driver.DspFuncLib 2.6.3f4
    com.apple.vecLib.kext 1.0.0
    com.apple.iokit.IOAudioFamily 1.9.7fc2
    com.apple.kext.OSvKernDSPLib 1.14
    com.apple.iokit.IOSurface 91.1
    com.apple.iokit.IOBluetoothFamily 4.2.7f4
    com.apple.driver.IOPlatformPluginLegacy 1.0.0
    com.apple.driver.AppleBacklightExpert 1.0.4
    com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.2.7f4
    com.apple.iokit.IOFireWireIP 2.2.6
    com.apple.driver.AppleHDAController 2.6.3f4
    com.apple.iokit.IOHDAFamily 2.6.3f4
    com.apple.driver.AppleSMBusPCI 1.0.12d1
    com.apple.driver.IOPlatformPluginFamily 5.7.1d6
    com.apple.nvidia.classic.NVDANV50HalTesla 8.2.4
    com.apple.driver.AppleSMBusController 1.0.12d1
    com.apple.nvidia.classic.NVDAResmanTesla 8.2.4
    com.apple.iokit.IONDRVSupport 2.4.1
    com.apple.iokit.IOGraphicsFamily 2.4.1
    com.apple.driver.AppleSMC 3.1.8
    com.apple.driver.AppleUSBMultitouch 240.10
    com.apple.iokit.IOUSBHIDDriver 660.4.0
    com.apple.driver.AppleUSBMergeNub 650.4.0
    com.apple.iokit.IOSCSIMultimediaCommandsDevice 3.6.7
    com.apple.iokit.IOBDStorageFamily 1.7
    com.apple.iokit.IODVDStorageFamily 1.7.1
    com.apple.iokit.IOCDStorageFamily 1.7.1
    com.apple.iokit.IOAHCISerialATAPI 2.6.1
    com.apple.iokit.IOUSBUserClient 660.4.2
    com.apple.iokit.IOEthernetAVBController 1.0.3b4
    com.apple.driver.mDNSOffloadUserClient 1.0.1b5
    com.apple.iokit.IOFireWireFamily 4.5.5
    com.apple.iokit.IOAHCIFamily 2.6.5
    com.apple.iokit.IO80211Family 640.36
    com.apple.iokit.IONetworkingFamily 3.2
    com.apple.driver.NVSMU 2.2.9
    com.apple.driver.AppleEFINVRAM 2.0
    com.apple.driver.AppleEFIRuntime 2.0
    com.apple.iokit.IOHIDFamily 2.0.0
    com.apple.iokit.IOSMBusFamily 1.1
    com.apple.security.sandbox 278.11.2
    com.apple.kext.AppleMatch 1.0.0d1
    com.apple.security.TMSafetyNet 7
    com.apple.driver.AppleKeyStore 2
    com.apple.driver.DiskImages 371.1
    com.apple.iokit.IOReportFamily 23
    com.apple.driver.AppleFDEKeyStore 28.30
    com.apple.iokit.IOUSBMassStorageClass 3.6.0
    com.apple.driver.AppleUSBComposite 656.4.1
    com.apple.iokit.IOSCSIBlockCommandsDevice 3.6.7
    com.apple.iokit.IOStorageFamily 1.9
    com.apple.iokit.IOSCSIArchitectureModelFamily 3.6.7
    com.apple.iokit.IOUSBFamily 686.4.1
    com.apple.driver.AppleACPIPlatform 2.0
    com.apple.iokit.IOPCIFamily 2.9
    com.apple.iokit.IOACPIFamily 1.4
    com.apple.kec.corecrypto 1.0
    com.apple.kec.pthread 1
    Model: MacBookPro7,1, BootROM MBP71.0039.B0B, 2 processors, Intel Core 2 Duo, 2.4 GHz, 8 GB, SMC 1.62f7
    Graphics: NVIDIA GeForce 320M, NVIDIA GeForce 320M, PCI, 256 MB
    Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1067 MHz, 0x01BA, 0x202020202020202020202020202020202020
    Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1067 MHz, 0x01BA, 0x202020202020202020202020202020202020
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.106.98.100.22)
    Bluetooth: Version 4.2.7f4 15112, 3 services, 15 devices, 1 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: TOSHIBA MK2555GSXF, 250.06 GB
    Serial ATA Device: MATSHITADVD-R   UJ-898
    USB Device: Internal Memory Card Reader
    USB Device: Built-in iSight
    USB Device: BRCM2046 Hub
    USB Device: Bluetooth USB Host Controller
    USB Device: IR Receiver
    USB Device: Apple Internal Keyboard / Trackpad
    Thunderbolt Bus:

    You can look in (BEING VERY CAREFUL)
    Finder -> Go -> Go to Folder -> /System/Library/Extensions
    The reason to be careful is that this is where Mac OS X keeps all its official extensions.  And if you accidentally delete the wrong thing in here, you can "Brick" your Mac.
    You should have a good backup before attempting anything in the /System/Library/Extensions folder.
    -OR- there is a brute force search from an Applications -> Utilities -> Terminal session
    sudo find / -iname "*BlackBerryUSBDriverInt*" 2>/dev/null
    Password: enter your admin password here - it will NOT echo, just type it blindly, and hit <return>
    sudo find / -iname "*VaraAudio*" 2>/dev/null
    Password:
    The Terminal 'find' command starting in the / directory will search everything on your system.  It can take a long time, but it is very complete.

  • Can somebody please address this topic?

    This topic below was posted by another, never addressed or answered. This is a major issue when working in an design environment where the majority of employees are working on a PC and need visuals of the products being designed (ie: salespeople, clients etc.).
    Is there a fix or patch, or has adobe changed a setting in their last update and not told anybody about it?.
    'b' Mac Jpegs cannot open in PC environment since Leopard
    jeffrey johnson - 07:52am Mar 27, 2008 Pacific
    Hi. I am hoping someone will be able to help me. We have been running CS2, and Tiger, then went to Leopard. I am not sure that's when the problem started or not, or if it's just a coincidence. My problem is this:
    People in my building ( who run PCs ) want a jpeg of some image. I have been creating them using Photoshop CS2, and then emailing them. No problem. However as of late, and could have been since Leopard has been installed, I am not sure, people cannot open them anymore on their PCs. I make sure they are RGB format, no paths or anything that would possibly make in unopenable I just installed CS3 today, as a matter of fact, and thought the new version of photoshop might fix this problem somehow for me, it didn't.
    Here's my work around: I created and save out the jpeg in PS, and from there I open this up in Apple's Preview. From there I re-save the jpeg, and then people can open it on their PCs. Isn't that weird? Obviously one extra step that I wish I didn't have to do, that when working in a busy environment, seems to be a lot longer.
    Does anyone know why this happens or how to fix it?
    Thank you very much,
    -Jeff

    Gerald apparently could not scroll down through the first three posts of Jeffrey Johnson's original topic. On the third post Jeffrey said "
    That fixed it! ( setting my Entourage preferences )". I'm not sure how Gerald could think it was
    never addressed or answered.
    And I'm not sure why Gerald would need to search the forum to find the same thread he quoted.
    I figured there was no point in trying to contribute anything logical here so I suggested zipping.

  • Can somebody please answer this question about muse

    here is the thread to my original question.
    http://forums.adobe.com/thread/1290038
    Ben
    Thank you

    To be more specific, my question was will having two of these scripts work? And does it make a difference if there is a return space between the two scripts? I am not a coder and don't understand. Can it be explained in a simple step by step process? The properties box would be open, Then paste googles code? hit return, paste Bing's code. if by hitting return closed the properties dialog box, I could possibly re-open, insert curser a line below googles code then paste?
    sorry to be such a newby
    Ben

  • Any one  please correct  this code it is not giving the result as expected.

    class image {
         public int[][] data;
         public int rows;
         public int columns;
    public class BlurImage {
    public int function1(image i1,int k,int j,int rad)
                   int sum=0;
                   int count=0;
                   int R=0,G=0,B=0;
                   String s=new String();
                   for(int x=k-rad;x<=k+rad;x++)
                        if(x<0 || x>=i1.rows)
                             continue;
    for(int y=j-rad;y<=j+rad;y++)
                             if(y<0 || y>=i1.columns)
                                  continue;
    s=Integer.toHexString(i1.data[x][y]).substring(4,6);
                             B=B+Integer.valueOf(s, 16).intValue();
                             s=Integer.toHexString(i1.data[x][y]).substring(2,4);
                             G=G+Integer.valueOf(s, 16).intValue();
                             s=Integer.toHexString(i1.data[x][y]).substring(0,2);
                             R=R+Integer.valueOf(s, 16).intValue();
    count++;
                   R=R/count;
                   G=G/count;
                   B=B/count;
                   System.out.println(" ");
                   String s1=new String();
                   s1=Integer.toHexString(R).concat(Integer.toHexString(G));
                   s1=s1.concat(Integer.toHexString(B));
                   System.out.println(Integer.valueOf(s1, 16).intValue()+" ");
                   return Integer.valueOf(s1, 16).intValue();
    public image blur_image(image i, int radius) {
              //Write your code here
              if(i.rows<radius || i.columns<radius)
                   return null;
              image i1 = new image();
              i1.rows=i.rows;
              i1.columns=i.columns;
              i1.data=new int[i.rows+1][i.columns+1];
              for (int k = 0; k < i.rows; k++)
              for (int j = 0; j < i.columns; j++)
                        if(i.data[k][j]>0xFFFFFF)
                             return null;
                        i1.data[k][j]=(int)function1(i,k,j,radius);
              return i1;
    public static void main(String[] args) {
    //TestCase 1
    try {
    image i = new image();
    i.rows = 5;
    i.columns = 3;
    i.data = new int[][]{{6, 12, 18}, {5, 11, 17}, {4, 10, 16}, {3, 9, 15}, {2, 8, 14}};
    BlurImage obj = new BlurImage();
    image res = obj.blur_image(i, 2);
    System.out.println("TestCase 1");
    if (res != null) {
    for (int k = 0; k < i.rows; k++) {
    System.out.println();
    for (int j = 0; j < i.columns; j++) {
    System.out.print(res.data[k][j] + ",");
    } else
    System.out.println("NULL");
    catch (Exception e) {
                   e.printStackTrace();
    //TestCase 2
    try {
    image i = new image();
    i.rows = 3;
    i.columns = 5;
    i.data = new int[][]{{0x5a0060, 0x6a0050, 0x6a0050, 0x6a0050, 0x7f0038},
    {0x5a0060, 0x6a0050, 0x6a0050, 0x6a0050, 0x7f0038},
    {0x5a0060, 0x6a0050, 0x6a0050, 0x6a0050, 0x7f0038}};
    BlurImage obj = new BlurImage();
    image res = obj.blur_image(i, 1);
    System.out.println("\nTestCase 2");
    if (res != null) {
    for (int k = 0; k < i.rows; k++) {
    System.out.println();
    for (int j = 0; j < i.columns; j++) {
    System.out.print(Integer.toHexString(res.data[k][j])+ ",");
    } else
    System.out.println("NULL");
    catch (Exception e) {
    e.printStackTrace();
    It should give the output as:------
    test case 1:-
    [ 11, 11, 11 ]
    [ 10, 10, 10 ]
    output.data = [ 10, 10, 10 ]
    [ 9,    9,   9  ]
    [ 9,    9,   9  ]
    test case 2:-
    [ 0x620058, 0x640055, 0x6a0050, 0x710048, 0x740044 ]
    output.data = [ 0x620058, 0x640055, 0x6a0050, 0x710048, 0x740044 ]
    [ 0x620058, 0x640055, 0x6a0050, 0x710048, 0x740044 ]

    public class Test
         public static void main(String args[])
              throws Exception
              System.out.println("[ 10, 10, 10 ]");
    }I'll let you customize the above code for test case 2.
    There is not a single comment in the code. We have no idea what the code is supposed to do. We have no idea what you think is wrong. Therefore the above solution is the best we can provide.

  • I need some help with my java game using applets, CAN SOMEBODY PLEASE HELP

    Hi,
    I am in the process of creating a RPG program using Java. I am not very experienced with java, however the problem i am currently facing is something i can't seem to figure out. I would like to draw a simple grid where a character (indicated by a filled circle) moves around this grid collecting items (indicated by a red rectangle). When the character moves on top of the grid with the item, i would like it to disappear. Right now i am not worrying about the fact that the item will reappear after the character moves away again, because sometimes, when the character moves over the item, nothing happens/another item disappears. i have been at this for 4 days and still cannot figure out what is goign on. can somebody please help me? it would be most appreciated.
    Thanks
    PS if i needed to send you my code, how do i do it?

    Thank you for replying.
    The thing is, I am taking java as a course, and it is necessary for me to start off this way (this is for my summative evaluation). i agree with you on the fact, however, that i should go in small steps. i have been doing that until this point, and my frustration caused me to jump around randomly for an answer. I also think that it may just be a bug, but i have no clue as to how to fix it, as i need to show my teacher at least a part of what i was doing by sometime next week. Here is my code for anybody willing to go through it:
    // The "Keys3" class.
    import java.applet.*;
    import java.awt.*;
    import java.awt.Event;
    import java.awt.Font;
    import java.awt.Color;
    import java.applet.AudioClip;
    public class Keys3 extends java.applet.Applet
        char currkey;
        int currx, curry, yint, xint;
        int itmval [] = new int [5],
            locval [] = new int [5],
            tempx [] = new int [5], tempy [] = new int [5],
            tot = 0, score = 0;
        boolean check = true;
        AudioClip bgSound, bgSound2;
        AudioClip hit;
        private Image offscreenImage;
        private Graphics offscreen;     //initializing variables for double buffering
        public void init ()  //DONE
            bgSound = getAudioClip (getCodeBase (), "sound2_works.au");
            hit = getAudioClip (getCodeBase (), "ah_works.au");
            if (bgSound != null)
                bgSound.loop ();
            currx = 162;
            curry = 68;
            setBackground (Color.white);
            for (int count = 0 ; count < 5 ; count++)
                itmval [count] = (int) (Math.random () * 5) + 1;
                locval [count] = (int) (Math.random () * 25) + 1;
            requestFocus ();
        public void paint (Graphics g)  //DONE
            resize (350, 270);
            drawgrid (g);
            if (check = true)
                pickitems (g);
                drawitems (g);
            g.setColor (Color.darkGray);
            g.fillOval (currx, curry, 25, 25);
            if (currkey != 0)
                g.setColor (Color.darkGray);
                g.fillOval (currx, curry, 25, 25);
            if (collcheck () != true)
                collision (g);
            else
                drawitems (g);
        } // paint method
        public void update (Graphics g)  //uses the double buffering method to overwrite the original
                                         //screen with another copy to reduce flickering
            if (offscreenImage == null)
                offscreenImage = createImage (this.getSize ().width, this.getSize ().height);
                offscreen = offscreenImage.getGraphics ();
            } //what to do if there is no offscreenImage copy of the original screen
            //draws the backgroudn colour of the offscreen
            offscreen.setColor (getBackground ());
            offscreen.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
            //draws the foreground colour of the offscreen
            offscreen.setColor (getForeground ());
            paint (offscreen);
            //draws the offscreen image onto the main screen
            g.drawImage (offscreenImage, 0, 0, this);
        public boolean keyDown (Event evt, int key)  //DONE
            switch (key)
                case Event.DOWN:
                    curry += 46;
                    if (curry >= 252)
                        curry -= 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.UP:
                    curry -= 46;
                    if (curry <= 0)
                        curry += 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.LEFT:
                    currx -= 66;
                    if (currx <= 0)
                        currx += 66;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.RIGHT:
                    currx += 66;
                    if (currx >= 360)
                        currx -= 66;
                        if (hit != null)
                            hit.play ();
                    break;
                default:
                    currkey = (char) key;
            repaint ();
            return true;
        public boolean collcheck ()  //DONE
            if (((currx == tempx [0]) && (curry == tempy [0])) || ((currx == tempx [1]) && (curry == tempy [1])) || ((currx == tempx [2]) && (curry == tempy [2])) || ((currx == tempx [3]) && (curry == tempy [3])) || ((currx == tempx [4]) && (curry == tempy [4])))
                return false;
            else
                return true;
        public void collision (Graphics g)
            drawgrid (g);
            for (int count = 0 ; count < 5 ; count++)
                if ((currx == tempx [count]) && (curry == tempy [count]))
                    g.setColor (Color.darkGray);
                    g.fillOval (currx, curry, 25, 25);
                else if ((currx != tempx [count]) && (curry != tempy [count]))
                    g.setColor (Color.red);
                    g.fillRect (tempx [count], tempy [count], 25, 25);
        public void drawitems (Graphics g)
            for (int count = 0 ; count < 5 ; count++)
                g.setColor (Color.red);
                g.fillRect (tempx [count], tempy [count], 25, 25);
        public void pickitems (Graphics g)
            check = false;
            for (int count = 0 ; count < 5 ; count++)
                if (locval [count] <= 5)
                    tempy [count] = 22;
                else if (locval [count] <= 10)
                    tempy [count] = 68;
                else if (locval [count] <= 15)
                    tempy [count] = 114;
                else if (locval [count] <= 20)
                    tempy [count] = 160;
                else if (locval [count] <= 25)
                    tempy [count] = 206; //this determines the y-position of the item to be placed
                if (locval [count] % 5 == 0)
                    tempx [count] = 294;
                else if ((locval [count] == 1) || (locval [count] == 6) || (locval [count] == 11) || (locval [count] == 16) || (locval [count] == 21))
                    tempx [count] = 30;
                else if ((locval [count] == 2) || (locval [count] == 7) || (locval [count] == 12) || (locval [count] == 17) || (locval [count] == 22))
                    tempx [count] = 96;
                else if ((locval [count] == 3) || (locval [count] == 8) || (locval [count] == 13) || (locval [count] == 18) || (locval [count] == 23))
                    tempx [count] = 162;
                else if ((locval [count] == 4) || (locval [count] == 9) || (locval [count] == 14) || (locval [count] == 19) || (locval [count] == 24))
                    tempx [count] = 228;
        public void drawgrid (Graphics g)  //DONE
            g.drawRect (10, 10, 330, 230); //draws the outer rectangular border
            int wi = 10; //width of one square on the board
            int hi = 10; //height of one square on the board
            for (int height = 1 ; height <= 5 ; height++)
                for (int row = 1 ; row <= 5 ; row++)
                    if (((height % 2 == 1) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))
                        g.setColor (Color.gray);
                        g.fillRect (wi, hi, 66, 46);
                    else /*if (((height % 2 == 0) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))*/
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46);
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46); //drawn twice to make a shadow effect
                    wi += 66;
                wi = 10;
                hi += 46;
            } //this draws the basic outline of the game screen
    } // Keys3 class

  • Can somebody please delete a post for me?

    Can somebody please delete this thread: https://discussions.apple.com/message/18023979#18023979
    It contains personal information I do not want others viewing. If possible, can you also delete this threat afterwards?

    I will ask a forum moderator to have it deleted, but I have no control over whether or not they do get deleted. Also, I'd give it a day or so, it won't be instant.  I'm not sure what their hours are.

  • Can somebody please simplify/tune this query?

    Hi,
    Can somebody please simplify this query?
    It's a little urgent. Currently this query is taking 10 mins to run.
    Thank you so much,
    vasu
    Purpose:
    First Child Case Ind =
    Get Parent Case for this case.
    Get all child cases for this parent case.
    Arrange them in ascending order by create Date.
    If the first case (eldest case) is the case in question,
    then Y
    else N
    Query:
    SELECT THIS_CASE.OBJID THIS_CASE_OBJID,
    PARENT.PARENT_OBJID,
    (CASE
    WHEN PARENT.FIRST_CHILD_OBJID = THIS_CASE.OBJID
    THEN 'Y'
    ELSE 'N'
    END) IS_FIRST_CHILD_CASE
    FROM SA.TABLE_CASE THIS_CASE,
    (SELECT PARENT_OBJID,
    CHILD_OBJID FIRST_CHILD_OBJID
    FROM (SELECT PARENT_CASE.OBJID PARENT_OBJID,
    CHILD_CASE.OBJID CHILD_OBJID,
    CHILD_CASE.CREATION_TIME,
    ROW_NUMBER() OVER (PARTITION BY PARENT_CASE.OBJID
    ORDER BY CHILD_CASE.CREATION_TIME ASC) ROW_NUM
    FROM SA.TABLE_CASE PARENT_CASE,
    SA.TABLE_CASE CHILD_CASE
    WHERE PARENT_CASE.OBJID = CHILD_CASE.CASE_VICTIM2CASE
    WHERE ROW_NUM = 1
    ) PARENT
    WHERE THIS_CASE.CASE_VICTIM2CASE = PARENT.PARENT_OBJID(+)

    Thank you for the quick reply.
    Here is the explain plan:
    Operation     Object Name     Rows     Bytes     Cost
    SELECT STATEMENT Optimizer Mode=CHOOSE          2 M          32831
    HASH JOIN OUTER          2 M     130 M     32831
    TABLE ACCESS FULL     SA.TABLE_CASE     2 M     24 M     21550
    VIEW          307 K     11 M     10130
    WINDOW SORT PUSHED RANK          307 K     7 M     10130
    MERGE JOIN          307 K     7 M     8666
    TABLE ACCESS BY INDEX ROWID     SA.TABLE_CASE     307 K     4 M     1266
    INDEX FULL SCAN     SA.IND_CASE_VICTIM2CASE     307 K          738
    SORT JOIN          2 M     19 M     7400
    INDEX FAST FULL SCAN     SA.PK_TABLE_CASE     2 M     19 M     785
    Please let me know.
    Thank you.

  • I just want to know that if I buy an iphone 4S here in melbourne can i use it in china? i don`t know whether it`s locked or not and i don`t know what`s the network in china as well. Can somebody please help?I am really in a hurry to know it. Thanks a lot.

    I just want to know that if I buy an iphone 4S here in melbourne can i use it in china?
    i don`t know whether it`s locked or not and i don`t know what`s the network in china as well.
    Can somebody please help?
    I am really in a hurry to know it.
    Thanks a lot.
    P.S: For the iphone 4S. is there any difference for the one from online shop or the actual store?

    iPhones purchased from the online Apple Store in Australia will be unlocked. To the best of my knowledge, unlocked iPhone are not available from the physical Apple Stores at this time, though you can call the Apple Store in Melbourne and inquire.
    Note that the warranty on iPhones is not international, so if you purchase an iPhone in Australia and it needs service, you would have to ship the iPhone to someone in Australia to take or send to Apple for service and then ship it back to you.
    Regards.
    (Note for any readers: this is an old thread and I posted before noticing the date, but decided to leave my reply in case anyone else finds the thread and has the same question).

  • Hi can somebody please help me to get Apple phone support stop calling me to tell me that i NOT awnsering the phone!!!!

    Hi can somebody please help me to get Apple phone support stop calling me to tell me that i NOT awnsering the phone!!!!

    The battery capacity on a 5S is a little better but be sure to read the special notes on conserving battery power on these phones.   Here are two in particular.
    17 Tips to Extend iPhone Battery Life (Updated for iOS 7)
    How to improve iPhone battery life, what to do if your iPhone battery is running low - How to - Macworld UK
    Regards,  71

  • Can somebody please tell me what 'genius' included 'family' in reminders, and, made it so i cannot remove it.  I have NO family, and, i find this particularly hurtful and disrespectful.  Can somebody please help me remove it.

    Can somebody please tell me what 'genius' included 'family' in reminders, and, made it so i cannot remove it.  I have NO family, and, i find this particularly hurtful and disrespectful.  Can somebody please help me remove it.

    Hi EmmeElle,
    Is it an iCloud reminder or a third party reminder like from an Exchange account(maybe your company provides this service together with mail etc..).
    In the first case you should definitely be able to delete it by right click->delete or via https://www.icloud.com
    In the second case there might be a browser based settings page from your company or the provider of the service (i.e. Exchange) itself. Otherwise you can go to your System Preferences -> Internet Accounts and deactivate reminders for this account. WARNING: this also deletes all other reminder lists and reminders from this service on your mac.
    jl

Maybe you are looking for

  • How can i read all the lines from a text file in specific places and use the data ?

    string[] lines = File.ReadAllLines(@"c:\wmiclasses\wmiclasses1.txt"); for (int i = 0; i < lines.Length; i++) if (lines[i].StartsWith("ComboBox")) And this is how the text file content look like: ComboBox Name cmbxOption Classes Win32_1394Controller C

  • List Builder only shows 1 data set at a time

    Am attempting to get a list builder to display multiple data sets but am hitting a wall.  When a 1st data set is selected then all OK.  Add 2nd data set and update list and only 1st is shown.  Remove 1st and update and data is refreshed to 2nd list. 

  • Installed OSX update and apps won't open

    I just installed the latest OS-X update and now only Safari will open. I can't run Software update to reload the update. Can someone help me. Thank you!

  • DELETE_CONFIRM_MSG

    How can we alter the DELETE_CONFIRM_MSG in APEX. I am using Application Express 3.2.0.00.27. Presently the message is " Would you like to perform this delete action?". I am calling this JS in DELETE button javascript:confirmDelete(htmldb_delete_messa

  • What kind of Cellphone supports for Web Services in Java Application?

    I have developed a software in J2ME integrated with Web Services! I am wondering what kind of Cellphone (Nokia, Samsung, ...) supported Web Services now? Any help is appreciate!