473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

sync two forms

Hi im using MS Access 2000 for my project im tying to have a form that will ask users to input like a ticket number if not found it will go to another form. But the scenario is that the one inputted by the user (which is not found) will be like copied over to the form.

So far this is what I have:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Hero_Click()
  2. On Error GoTo Err_Kalabit2
  3.     Dim strStudentRef_2 As String
  4.     Dim strSearch_2 As String
  5.     Dim newcustid As Long
  6.  
  7.  
  8.  
  9.  
  10.     If IsNull(Me![txtSearchUser]) Or (Me![txtSearchUser]) = "" Then
  11.         MsgBox "Please enter a value!", vbOKOnly, "Invalid Search Criterion!"
  12.         Me![txtSearchUser].SetFocus
  13.  
  14.     Exit Sub
  15.     End If
  16.  
  17.     DoCmd.ShowAllRecords
  18.     DoCmd.GoToControl ("SC_Ticket_Number")
  19.  
  20.     DoCmd.FindRecord Me!txtSearchUser
  21.  
  22.     SC_Ticket_Number.SetFocus
  23.     strStudentRef_2 = SC_Ticket_Number.Text
  24.  
  25.     txtSearchUser.SetFocus
  26.     strSearch_2 = txtSearchUser.Text
  27.  
  28.  
  29. If strSearch_2 = SC_Ticket_Number Then
  30.  
  31.      MsgBox "Match Found For: " & strSearch_2, , "Please type in another incident ticket number."
  32.      SC_Ticket_Number.SetFocus
  33.  
  34.      txtSearchUser = ""
  35.  
  36. Else
  37.         MsgBox "Match Not Found For: " & strSearch_2 & " - You may proceed to TQC using this ticket number."
  38.         txtSearchUser.SetFocus
  39.  
  40.         newcustid = Forms!TQC_IMG_IMG!cboSC_Ticket.Value
  41.  
  42.         'Forms![TQC_IMG_IMG]![cboSC_Ticket] = txtSearchUser.Text
  43.         'Forms("MainFormName").[frmSubFrmName].Form.[Fieldname]
  44.         Forms("TQC_IMG_IMG").[frmIMG_SearchTicket].Forms.[txtSearchUser]
  45.  
  46.        DoCmd.Close acForm, "frmIMG_SearchTicket"
  47.        DoCmd.GoToRecord acdataforn, "TQC_IMG_IMG", acNewRec
  48.        Forms![frmIMG_SearchTicket]!txtSearchUser.Value = newcustid
  49.        Forms![TQC_IMG_IMG].[cboSC_Ticket].SetFocus
  50.  
  51.  
  52.   End If
  53.  
  54.  
  55. Exit_Kalabit2:
  56.     Exit Sub
  57.  
  58. Err_Kalabit2:
  59.     MsgBox Err.Description
  60.     Resume Exit_Kalabit2
  61. End Sub

Pls help me so the value will go to the next form :)

Thanks in advance
Sep 24 '07 #1
6 2037
Scott Price
1,384 Expert 1GB
What happens when you try to run this code as you have posted it?

One problem I see just on a quick scan is that you are referring to a form in line 48 that you closed already in line 46... This will result in an error something like: "Cannot find [FormName]"

You also have a misspelling in line 47: should be acDataForm, not acDataForn.

How many problems show up when you do a Debug>Compile command?

Regards,
Scott
Sep 24 '07 #2
there are a lot of error like "Cannot open in design view " etc.

So i will remove line 48?

ill try it so i can check from my end if there are any error messages and keep you posted :)

Thank you very much
Sep 24 '07 #3
Scott Price
1,384 Expert 1GB
there are a lot of error like "Cannot open in design view " etc.

So i will remove line 48?

ill try it so i can check from my end if there are any error messages and keep you posted :)

Thank you very much
Take care of any problem that shows up on the Debug>Compile first. Then move on to changing a few other things.

Regards,
Scott

p.s. And yes, I can't think why you would want line 48 to stay... comment it out also.
Sep 24 '07 #4
hi scott,

i have tried what you said and there are no errors in the Compile in VB but i have an error

"microsoft access can't find the form 'TQC_IMG"IMG' referred to in a macro or visual basic code"
Sep 24 '07 #5
Expand|Select|Wrap|Line Numbers
  1. newcustid = Forms!TQC_IMG_IMG!cboSC_Ticket.Value
  2.  
  3.         MsgBox "Match Not Found For: " & strSearch_2 & " - You may proceed to TQC using this ticket number."
  4.         txtSearchUser.SetFocus
  5.  
  6.         DoCmd.Close acForm, "frmIMG_SearchTicket"
  7.         DoCmd.GoToRecord acDataForm, "TQC_IMG_IMG", acNewRec
  8.         Forms![TQC_IMG_IMG].[cboSC_Ticket].SetFocus
Sep 24 '07 #6
Scott Price
1,384 Expert 1GB
Well, it has to be open before it can find it, don't you think? How about putting in a DoCmd.OpenForm "[FormName]" command line in there before you reference the control on that form.

Regards,
Scott
Sep 24 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: kartik | last post by:
I open an fstream in read-only mode, read till the end, then try to sync() before seeking to position 0 & reading again. But the sync fails. I discovered that clear()ing the stream before the sync...
1
by: Bryan | last post by:
I am writing a C# Windows App that updates out Excel reports' modules. The app is complete, but has a problem. The only way MS allows you to unprotect the VBA code in Excel is to do it by hand or...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
3
by: Ryan Liu | last post by:
Hi, What does ArrayList.Synchronized really do for an ArrayList? Is that equal to add lock(this) for all its public methods and properties? Not just for Add()/Insert()/Remvoe()/Count, but also...
7
by: Ole | last post by:
Hi, I'm going to develop a socket communication between an instrument (running CE 5.0 with Compact Fraework V2) and a PC. As the instrument should only connect to one PC at a time I believe that...
3
by: iKiLL | last post by:
Hi , I am trying to debug a problem with a Windows Mobile Application. I need the PDA to Sync(I have writen the sync process myself using a web service) using GPRS while Debugging from the VS...
7
by: john | last post by:
I am reading TC++PL3 and on page 644 it is mentioned: "Flushing an istream is done using sync(). This cannot always be done right. For some kinds of streams, we would have to reread characters...
29
by: zalek | last post by:
I am writing application with Ajax in sync mode - xmlHttp.open("GET", url, false). I noticed that in FireFox handler doesn't starts. It starts when I use xmlHttp.open("GET", url,true). I need to...
3
by: OldBirdman | last post by:
Help & Support - Start syncing 1. Click to open Sync Center - OK I did that 2. On the toolbar, click Sync All - There is NO toolbar So under Tasks, I click "Set up new sync partnerships". ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.