Open Form With Specified Recordset
Jul 28, 2005
hi, im a beginner in access and want to do something like that:
<edit>this is in the DetailButton_Click() event</edit>
stDocName = "PersonDetails_Form"
DoCmd.RunCommand acCmdSaveRecord
'open form with recordset of person
DoCmd.OpenForm stDocName, , , "[P_ID] = " & Forms![PersonBase_Form]![P_ID]
'now the part i dont know how to do
If Not "[P_ID] = " & Forms![PersonBase_Form]![P_ID] Then
DoCmd.OpenForm stDocName, , acNewRec .....
End If
-> if there is no recordset of the Person, create new recordset with P_ID(hidden) and PersonNumber(visible and editable) from PersonBase
View Replies
ADVERTISEMENT
Jun 30, 2014
I have three tables see below
tblplantitem
tblplantgroup
tblplantservice
so I have frm called frmplant which holds the plantgroupname I.E plant type (airblow,leads) then I have subform call plantitemtblsubform which holds the plant item serial number, value ,service date which works great now my problem I have command buttom on subformplantitemsubform then opens form call frmpopupPlantService this opens to show plantitem service history but when I add a record then save close then click the same plant item to open form frmpopupPlantService show no service history even when I just entered ...
View 5 Replies
View Related
Aug 2, 2012
I'm trying to open a recordset in vba and I'm getting the 3061 runtime error,Expected 1.
I'm trying to open a recordset with a query that uses a reference to a form control.
Code:
searchtable1 = "qInVisio_RSV"
Set rs = db.OpenRecordset(searchtable1, dbOpenDynaset, dbSeeChanges)
This is the sql of the query:
The highlighted parted is the form referance ( I know it's obvious, just for easier spotting )
Code:
SELECT dbo_FOLIO.FOLIOID, dbo_FOLIO.KIND, dbo_FOLIO.RSVID, dbo_FOLIO.CHKIDATE, dbo_RLIST.ROOMID, dbo_ROOM.ROOMNO, dbo_AGN.LINAPRG
FROM (dbo_ROOM INNER JOIN (dbo_FOLIO INNER JOIN dbo_RLIST ON dbo_FOLIO.RSVID = dbo_RLIST.RSVID) ON dbo_ROOM.ROOMID = dbo_RLIST.ROOMID) LEFT JOIN dbo_AGN ON dbo_FOLIO.AGNID = dbo_AGN.AGNID
WHERE (((dbo_FOLIO.KIND)=101) AND ((dbo_FOLIO.CHKIDATE)>=[Forms]![frmCleaningPlan]![DTPicker]));
also as you can see it's a datepicker control, so the value is a date...
View 2 Replies
View Related
Mar 24, 2005
Hello All,
How do I open a recordset in Access.
Thanks
View 4 Replies
View Related
Sep 16, 2005
Someone please tell me what is wrong with this code? (I have already defined db_file earlier in the sub.)
' Open a connection.
Set conn = New ADODB.Connection
conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & db_file & ";" & _
"Persist Security Info=False"
strSQL = "SELECT * FROM Families"
conn.Open
' Open Families Table with a cursor that allows updates
Set rs = New ADODB.Recordset
rs.Open strSQL, conn, adOpenKeyset, adLockOptimistic, adCmdTable
This is the error I get. "Microsoft JET Database Engine --> Syntax Error in FROM Clause"
Thanks!
View 1 Replies
View Related
Jul 4, 2007
hey guys
having a corruption issue with my database, it happens when a user updates a record and a second user has that record open elsewhere. then when the second user closes they save their changes over the top, corrupting the whole record.
so i need to know with a recordset if there is a way to check if a second user is currently looking at the same record?
thanks
View 4 Replies
View Related
Jan 2, 2014
I have a continuous form that lists a group of records in a main form based on a query. On each line of this continuous form, there is a button that can be clicked to open the main form based on that record.
Code:
DoCmd.OpenForm "frmRAW", , , "[frmRAW].[FID]= " & Me.FID.Value
This works fine, although it filters the recordset to just that one record. What else do I need to apply the same recordset that is in the continuous form, so the user can also scroll through the records on the main form if they so wish to?
I want them to be able to click on the button in the continuous form, open the form to that record, but also give them the ability to scroll to the other records that were listed in the continuous form. The continuous form I mentioned is its own form seperate from the main form.
View 7 Replies
View Related
Apr 8, 2015
How to open a Record Set For the combo-box? My Original Code as follows
Dim conn As New ADODB.Connection
Dim objMyRecordset As New ADODB.Recordset
Dim strSQL As String
Set conn = New ADODB.Connection
[Code] ....
After i use this code nothing come out on my combo-box...
View 2 Replies
View Related
Jan 3, 2005
Hello all, I hope your hollidays were great!!
Ok I have a Continuous form that in one of it's fields contains Hyperlinks. The form is named [Song Info] and the field is [Play].
I want this field to be hidden and have a command button open up the hyperlink in that recordset. I think that all the info need
but if not let me know.
Thanks
Rich M
View 11 Replies
View Related
Dec 1, 2014
The code below fails.
Code:
Dim ResultQy As String, qdf As QueryDef
Dim ResultFm As String
ResultQy = "ByFederationQy"
Dim strSQL As String 'sql statement to execute
[Code] ....
When I run the code it fails at the last line giving error message:
Code:
Runtime error 3061 - toofew parameters expected 1
View 6 Replies
View Related
Nov 25, 2014
I am storing values of pictures and the location of them in a table, this works fine!... using OpenRecordset. The problem is that when the function is called to store the information, it just keeps adding the same values of each file in the folder over and over again in a word "Duplicating" the information.
I have tried various methods using the OpenRecordset, but cannot seem to find the correct manor of applying the code.
Below is the function I have for storing the data...
Code:
Public Sub GetFilesNamesFromFolder(strFolderPath As String)
On Error GoTo ErrorHandler
Dim objFSO As Scripting.FileSystemObject
Dim objFolder As Scripting.folder
Dim objFile As Scripting.File
[Code] .....
View 12 Replies
View Related
Feb 18, 2014
I'm trying to open or unlock a recordset do do a simple calclation and then relock the record set. How this can be done with vba?
View 7 Replies
View Related
Feb 5, 2005
I have a main form which has a subform control in it. when the main form is opened the sub form control contains a list of events in a sub form (a summary view), for the person selected in the main form.
I want to change the subform to a different one which shows the whole event when i click in a field on the subform, based on the event i clicked in. ( i can do it by opening a new form but not with a new subform)
I can make the form change using the following code:
Private Sub Notes_DblClick(Cancel As Integer)
Me.Parent.subformhere.SourceObject = "eventsfullrecord"
End Sub
What code do i need to make it open to the record i clicked in the summary form, rather than just opening to the first record every time?
Not very good at passing recordsets
Thank you
View 4 Replies
View Related
Aug 14, 2015
Special situation: The SQL Server Linked Server across the country is linked to a Read Only Oracle DB. This data pull works perfectly and populates the Subform.
The problem is that Oracle can take 3 to 6 seconds to retrieve the single record depending on the network traffic through a small pipe.
The code below shows the RecordSource for the SubForm. clicking on a list box supplies the value. Then 3 to 6 seconds later, the subform populates.
The actual Recordset for this Recordsource is needed to conduct Validation on each field. Normally this would be on SQL Server, I might just create a Recordset Oject and run this SQL statement again in 1 milisecond. In this case, it will probably take an additional 3 to 6 seconds. Avoiding another lengthy round-trip to Oracle would be prefered.
Goal: How does one grab, clone, or other wise reference the existing recordset for the SubForm?
Note: Immediate Window - One single field can be returned quickly
There are 48 fields that need validation - is there a way to reference the entire recordset?
Immediate Window during Break Mode:
? me.fsubsrNavSHLBHL("NavSH_QQ")
NESE ' this is the correct value for the current recordsource
Set a breakpoint right after the line:
fsubsrNavSHLBHL.Form.RecordSource = "Select * from vsrNavigatorSHLBHL where Well_ID =" & txtNavWellID.Value
Immediate Window:
? me.fsubsrNavSHLBHL.Form.RecordSource
Select * from vsrNavigatorSHLBHL where Well_ID =91229
View 4 Replies
View Related
Mar 22, 2005
Hi all
I would like to filter my form - AdminForm with a combo box. If the user selects one of the choices.... Open, Completed, Hold then the records would be sorted by that criteria. There is a bound combo on the form now for the user to choose the state that the record is in and it coincides with the sort terms. I also have an unbound combo set up to use for the sort - ComboStatusFilter. I was thinking that an SQL statement for the form properties should work but am not sure how to write it. Is this the right way to go about it? Any help would be appreciated! I have been reading and searching for days but as yet not found what I am looking for, or cant recognize it at least. LOL
Thanks!
View 2 Replies
View Related
Jun 26, 2006
I have a form (frmInfo) that I would like to use for 3 purposes.
1 - to enter to information (data entry mode)
2 - to view existinging information (for a single record)
3 - to edit existing information (for a single record)
There is a Main Menu that allows the user to choose, Enter New, View or Edit.
If they choose NEW: the form (frmInfo) will open for data entry
If they choose Edit or View, a form (frmSearch) with a listing of all jobs will open, the user then chooses which job to Edit or View...from here frmInfo is opened to display only the record chosen and the record will be editable or read-only depending on the choice from the Main form.
At what point should the frmInfo recordsource be defined?
View 1 Replies
View Related
Oct 4, 2006
I have a table that contains fields as follows: [userId], [userName], [userFullname]. About 10 users (records) in total.
I have a function username() that gets the username of a user from their logon.
Now on my form, i have a textbox that I'd like to display the Fullname of the user that's currently logged on the form (On Open event). Meaning, it will get their username from my function, then compare it to values in the users table and display the full name of the user when the user opens to form to view their records.
Can anyone enlighten me on how to do this. I have tried tried tried, my methods aren't getting me anywhere.
Any help, suggestions, ideas will be greatly appreciated!
View 2 Replies
View Related
Feb 27, 2013
I am setting up a form using a couple combo boxes. I want to populate a text box or 2 from the item record selected from one of the comboBox. Below is the code I am using.I have commented out where I am trying to transfer the value to the form, and try focusing on the query. When I run this code I get a type mismatch.
John
rivate Sub cbx_SlideNo_Change()
Me.Refresh
Dim StringSQL As String
Dim rs As Recordset
StringSQL = "SELECT Slides.[SlideTitle] "
StringSQL = StringSQL & "FROM Slides "
[code]....
View 6 Replies
View Related
Apr 27, 2007
Hi guys, I'm a bit confused: I know that opening a bound form will bring down the whole recordset. But if I create a parametered query as the recordsource, will it still bring down the whole recordset first and only afterwards cut down to the records matching the parameters?
Example: I have a clients table with 5000 clients on a backend mdb, and my client lookup form in my frontend mdb. If I open the form looking for just client "Jim Jones" (via the parameter query), will Access bring down all 5000 clients from the backend to my frontend first, and only then seek out "Jim Jones" before discarding the rest of the recordset?
For if this is true then this whole Access business is rather unsuited for networks, even a small one. I hope you guys prove me wrong.
Premy
View 14 Replies
View Related
Jul 7, 2013
I want to write a email where there are 2 or 3 different ordernumbers for same email, i want to include the email in the mail part as single column table. how to do it? also can i use result of one recordset for other recordset?
View 1 Replies
View Related
Jan 14, 2015
when i open a form i want to open another frm at the same time. i have a main form with some buttons in it. when i click on a button and a form opens then i am not able to click on a button to open other forms from the main form.
View 2 Replies
View Related
Apr 13, 2005
HI all
I have form containing some filtered records. What code do I need to put on a button to trigger a make-table query; the make-table thus containing only the current filtered records (not the entire database).
The following will use the entire database:
Dim stDocName As String
stDocName = "qryMakeTableCompanyID"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Thanks
John
View 1 Replies
View Related
Dec 19, 2005
Hi All
Im having some Major issues with this problem, i only hope someone can help me!!
Firstly, let me set the scene. I have 1 Form, And 1 Subform within that form. The form gets the Main Data, the SubForm gets all the Related Data (in this case, its all the Items Of Equipment this client has) and then lists them in the subform. So it could return 1, or it could return 20 records.
What we want from this is to be able to record what the client thought of the piece of equipment, so there is a Option Group on the SubForm, which allows the user to choose 1 of 6 options saying whether it was useful or not and things.
BUT here lies the problem, if the SubForm has returned 20 records, i change the OptionGroup on record one, and every other 19 records become the same. if i change Record 2, record 1 and 3 to 19 are the same.
I want to be able to have a seperate choice for each record returned, but tis not working!!
The subform is populated by calling a SQL SP, i cant set the form to link directly to a view or SP because access doesnt allow me, by saying the recordset is not updatable!
I hope all that makes sense!!
View 1 Replies
View Related
Aug 31, 2004
I have 2 forms. On form1, the record source is a query. From form2, I need to iterate through the recordset from form1 and perform some action. How do I access the recordset from form1?
Thanks in Advance,
-jnoody
View 1 Replies
View Related
Jun 18, 2014
Im still struggling with working with recordsets.What i want to achieve is to loop through a continuous form recordset, Using the OrderDetailFK from the record set and the OrderDetailPK in the OrderDetail Table
Looking at the Status FK in the OrderDetail Table. IF the OrderDetail Status = 2 then i want to make the textbox enable property = False. I have made the bellow SQL string which is placing all the criteria i just need to link it into a recordset?
Code:
mySQL = "SELECT [StatusFK] FROM [tblOrderDetail] WHERE [OrderDetailPK] = " & rst!OrderDetailFK & " AND [StatusFK] = 2 "";"""
View 4 Replies
View Related
Feb 22, 2015
I have an accdb file, holding all the tables on my server. Clients are linked to this one from their workstations. Speed is a constant issue mostly when more users are linked and I'm trying to find ways to make things faster.
Would it be possible to open a recordset when a form is loaded and set it as the form's data source? Would that make operation faster, at all?
The reason this idea came up is that it would be logical to use a small size recordset rather than large tables or queries that takes a while to load during starting form that use tables/queries with large number of records.
View 4 Replies
View Related