Display A Value In A Recordset On My Form

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 Replies


ADVERTISEMENT

Forms :: Recordset To Display Data On The Form

Jan 7, 2015

I am new to the Access programing. One of our clients wants to export the record set that is being displayed on the form to excel. We are using ADODB Recordset to display the data on the form. We also have some computed columns. Is there any way that I could export the data to excel?

View 4 Replies View Related

Display Count Of Recordscaptured In Recordset

Dec 1, 2005

A newbie question I'm sure. I'm looking to display the count of records captured in my recordset. I'd appreciated any assistance thanks.

<code>

<% rs.Open "SELECT Count(tblRequest.LastName) AS UserCount FROM tblRequest GROUP BY tblRequest.HR_checkbox HAVING ((tblRequest.HR_checkbox)=Yes));", adoconn %>

<%
if UserCount<>"" then
Response.Write(rs.UserCount) end if
rs.close %>

</code>

PS. The database is Access 2K

View 2 Replies View Related

Modules & VBA :: How To Extract Recordset From Subform Into Recordset Object

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

Form Recordset

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

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 4 Replies View Related

Changing A Form Recordset

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

Returning A Recordset For A Form

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

Does A Filtered Mdb Recordset Still Bring Down The Whole Recordset?

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

Modules & VBA :: Can Use Result Of One Recordset For Other Recordset

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

Make Table From Form Recordset

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

SQL Stored Procedure And A Form Recordset

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

Get The Recordset From The Record Source Of A Form

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

Modules & VBA :: Looping Through Form Recordset And Looking Up Value

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

General :: How To Open Another Form Keep Recordset

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

Forms :: Recordset As Datasource For A Form

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

Unwanted Additional Recordset After Closing A Form

Nov 14, 2006

Hi!
Solution is maybe simple, but I don't know it!
When I put some value in a control (textbox) on a form, and after that if I close a form (by x button) that recordset is added to a table, but I don't want to do that- I just want to exit (close) the form! How to avoid adding that recordset to a table?
Same things happens when I, by VBA, set focus to control, assign some value to it, and just want to exit the form.

Best regards,

View 4 Replies View Related

Modules & VBA :: Continuous Form - Loop Through Recordset

Jul 22, 2014

In my database, I have a continuous form with a Name, a Date and a Yes/No field.

When the form opens, I want to look at the date of every record on the form and show a message box if it is before the current day.

The code I have is this;

Private Sub Form_Load()
With Me.RecordsetClone
While Not .EOF
If Me.Date1 < Date Then
MsgBox "" & Me.Person & ""
End If
If Not .EOF Then .MoveNext
Wend
End With
End Sub

However, it loops just the first record the amount of times there is of records (i.e., it will only show the first person's name in the message box, and will show 3 times if there are 3 records).

View 7 Replies View Related

General :: Fabricated ADO Recordset Bound To Form

Dec 11, 2013

I am looking for a complete working example of a fabricated ADO recordset bound to a form. The purpose of this is to provide a selection tool for records of a table in a multiuser database.

I could do this using a table to store the selections in the db, but I want to get a tool I can reuse in the future, obviating the need for extra tables and keeping track of users and multiple copies of the application ran by the same user.

So far I can display MEMO text, all the other values of my recordset (yes they are present) generate #ERROR in the form controls.Yes I did google. Apparently I am not the only one with this problem, but the solutions range from bizarre to weird.

Code:
.Append "MailSubject", adLongVarWChar, 10000
' .Append "MailSubject", adVarChar, 255
.Append "MailBody", adLongVarWChar, 10000
.Append "MailID", adBigInt
.Append "MailTemplateID", adInteger
.Append "RevisionID", adInteger
.Append "SentOn", adDBTimeStamp
.Append "myField", adInteger

Any complete (with form) working example that includes at least one integer field in a record ...

View 7 Replies View Related

Modules & VBA :: How To Get Recordset For Empty Rows In Form

Oct 14, 2014

Are new, empty record in form have recordset presentation, how to get recordset in form for empty row?

View 1 Replies View Related

Forms :: Loop Through Continuous Form Recordset Crash

Jun 27, 2014

My application crashes when trying to change the value of a text box in a continuous form. Here is the code:

Code:
Private Sub cboPoCurrency_AfterUpdate()
On Error GoTo ErrHandler
Dim rst As Recordset

[Code].....

If I replace .txtUnitCost by MsgBox .txtUnitCost, it loops correctly through each record and returns the value. But if I try to change the value as shown in above code, MS Access crashes! (This is a desktop application with tables linked to SP lists - not a web app)

[URL]

View 14 Replies View Related

Forms :: Filtering A Form Based On ADODB Recordset?

Oct 16, 2013

I have a form that shows records from ADODB recordset.When I try to apply filter to the underlying recordset it works all right but the form doesn't reflect the changes. It shows same rows as before filtering. In debug I can see that the recordset contains only filtered records. Me.Refresh (Recalc, Requery) doesn't work.

Code is as follows:

Dim rs As New ADODB.Recordset
rs.Open sql, conn, adOpenStatic, adLockOptimistic
Set Me.Recordset = rs

Sub combo_AfterUpdate()
Me.Recordset.Filter = "CompanyNo = 123"
End Sub

The form is in Continuous forms mode. I cant use DAO because the data comes from SQL server user-defined function.

View 5 Replies View Related

Forms :: RecordSet Bound Form No Longer Filters

Sep 24, 2014

I have a number of forms that are bound to recordsets as follows:

Dim rs As New adodb.Recordset

sqlQuery = "Select * from myTable"
rs.Open sqlQuery, sqlCNN, adOpenKeyset, adLockOptimistic
Set Me.Recordset = rs
Set rs = Nothing

In Access 2003, users could open these forms and filter on basically any field by using the right click-> Text Filters functionality.

In Access 2010, this functionality appears to work (users can apply the filter and the Toggle Filter button in the ribbon shows a filter is applied), but all of the records are still visible in the form.

Any work-around that does not involve redesigning the form to be non-recordset bound?

View 4 Replies View Related

Modules & VBA :: Form Bound To ADODB Recordset Is Read Only - Cannot Edit?

Sep 4, 2013

I can't make edits with ADODB recordset bound to my form.

Access 2010 linking to SQL Server 2008.

Simple form bound to a single table.

Connection string works fine.

Code is as below (cursor etc is set using enums btw).

Private Sub Form_Open(Cancel As Integer)
Dim rst As ADODB.Recordset
If g1OpenRecordset(rst, "tblName", rrOpenKeyset, rrLockOptimistic, False) = False Then
Cancel = True
Exit Sub

[Code] ...

View 3 Replies View Related

General :: Sorting Recordset In Form - Add Numerical Field With Sequential Value

May 23, 2013

I've been building a small app for some friends. At present, they enter "records" line by line into a word processor, then use (archaic, IMHO) macros to produce the desired printouts. They wanted the new data entry UI to mimic that process.

Ok, so I've adopted the datasheet form as the principal entry vehicle. Based on the initial info they gave me, there were two convenient fields to sort on, so I used them in the OrderBy clause of the query which serves as the form's recordsource. I also developed the code to maintain the sort order after they inserted or deleted a record.

Now it turns out they don't require an entry into those fields, and in fact there's no logical field at all on which to order by.

So the question is: how to approach this? From my reading, I can't use the primary key or an autonumbered field, since the former won't necessarily reflect the desired incrementation and the latter only triggers for a new record, not an insertion (is this correct?).

My thought is to add a simple numerical field (which will be hidden from the user) with sequential values. I can do the OrderBy on it, and add code to adjust those values whenever a record is deleted or inserted. (That will require looping through the recordset from the point where the deletion or insertion occurred.)

For instance, is there some way to add a calculated field to the recordsource for this purpose?

View 11 Replies View Related

Forms :: Recordset Filters From One User Affecting All Users On A Form?

Jul 10, 2013

Here is the environment:

Currently, I have 10 Users running a front end form that connect to back end data where they add to current records and eventually check that the record is complete.

I also have an "Apply Filter" button on the right hand side of the form that allows the user to apply filters to the records to show specific data that is not complete.

I am currently hearing that while the user is working, whether they apply filter or not, it seems as though all of a sudden, all of their completed work dissapears from their recordset hence not allowing them to go back to make changes to it if needed. I can only conclude that when a different user clicks apply filter, all users are affect some how... here are some examples of the code for the filter:

Code:
Select Case [cboFilterValues] ' Where the user selects a filter parameter from a dropdown
Case "All Data"
strSQL = "SELECT * " & _
"FROM [Data Table] " & _
"WHERE [Complete] = No

Then it does:

Code:
Me.RecordSource = strSQL

I am basically trying to find a way where only the user wanting to view the filter is affected... FYI, the other users arent actually seeing all the filters from the other user filter choice, they simply loose all their completed work from their form.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved