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: - Private Sub Hero_Click()
-
On Error GoTo Err_Kalabit2
-
Dim strStudentRef_2 As String
-
Dim strSearch_2 As String
-
Dim newcustid As Long
-
-
-
-
-
If IsNull(Me![txtSearchUser]) Or (Me![txtSearchUser]) = "" Then
-
MsgBox "Please enter a value!", vbOKOnly, "Invalid Search Criterion!"
-
Me![txtSearchUser].SetFocus
-
-
Exit Sub
-
End If
-
-
DoCmd.ShowAllRecords
-
DoCmd.GoToControl ("SC_Ticket_Number")
-
-
DoCmd.FindRecord Me!txtSearchUser
-
-
SC_Ticket_Number.SetFocus
-
strStudentRef_2 = SC_Ticket_Number.Text
-
-
txtSearchUser.SetFocus
-
strSearch_2 = txtSearchUser.Text
-
-
-
If strSearch_2 = SC_Ticket_Number Then
-
-
MsgBox "Match Found For: " & strSearch_2, , "Please type in another incident ticket number."
-
SC_Ticket_Number.SetFocus
-
-
txtSearchUser = ""
-
-
Else
-
MsgBox "Match Not Found For: " & strSearch_2 & " - You may proceed to TQC using this ticket number."
-
txtSearchUser.SetFocus
-
-
newcustid = Forms!TQC_IMG_IMG!cboSC_Ticket.Value
-
-
'Forms![TQC_IMG_IMG]![cboSC_Ticket] = txtSearchUser.Text
-
'Forms("MainFormName").[frmSubFrmName].Form.[Fieldname]
-
Forms("TQC_IMG_IMG").[frmIMG_SearchTicket].Forms.[txtSearchUser]
-
-
DoCmd.Close acForm, "frmIMG_SearchTicket"
-
DoCmd.GoToRecord acdataforn, "TQC_IMG_IMG", acNewRec
-
Forms![frmIMG_SearchTicket]!txtSearchUser.Value = newcustid
-
Forms![TQC_IMG_IMG].[cboSC_Ticket].SetFocus
-
-
-
End If
-
-
-
Exit_Kalabit2:
-
Exit Sub
-
-
Err_Kalabit2:
-
MsgBox Err.Description
-
Resume Exit_Kalabit2
-
End Sub
Pls help me so the value will go to the next form :)
Thanks in advance
6 2037
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
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
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.
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"
- newcustid = Forms!TQC_IMG_IMG!cboSC_Ticket.Value
-
-
MsgBox "Match Not Found For: " & strSearch_2 & " - You may proceed to TQC using this ticket number."
-
txtSearchUser.SetFocus
-
-
DoCmd.Close acForm, "frmIMG_SearchTicket"
-
DoCmd.GoToRecord acDataForm, "TQC_IMG_IMG", acNewRec
-
Forms![TQC_IMG_IMG].[cboSC_Ticket].SetFocus
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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". ...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |